Re: Difference between two dates and times
From: quartz (quartz_at_discussions.microsoft.com)
Date: 10/20/04
- Next message: Brenda _at_ AIM: "importing different files"
- Previous message: Rick Brandt: "Re: Subtracting two fields in SQL syntax HELP"
- In reply to: John Vinson: "Re: Difference between two dates and times"
- Next in thread: Jamie Collins: "Re: Difference between two dates and times"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 20 Oct 2004 11:15:08 -0700
Thanks for your response, but I'm only using this to track the running time
on queries. This information is not recorded anywhere else.
Also, I am not using Access in a conventional manner, only as a container
for large amounts of data. I summarize the data and port it into Excel to do
my number crunching. My tables only contain the results of ADO queries run
against an Oracle DB.
"John Vinson" wrote:
> On Wed, 20 Oct 2004 07:19:04 -0700, quartz
> <quartz@discussions.microsoft.com> wrote:
>
> >I have two columns in a table. One is START_TIME the other is END_TIME and
> >they are both TIMESTAMP data types formatted as "MM-DD-YYYY HH:MM:SS AM/PM".
>
> Are these SQL Server tables? Access (JET) tables have a Date/Time
> datatype but do not have a Timestamp.
>
> >In a third column (ELAPSED_TIME) I want to calculate the difference between
> >the first two columns (i.e. END_TIME - START_TIME) and show the difference
> >with a picture of: DD HH:MM:SS or DD-HH:MM:SS (example result: 00 00:01:34 or
> >00-00:02:18).
> >
> >My calculation is running in the current Access DB project and will update
> >the table with the calculation using SQL. PLEASE NOTE: Sometimes this process
> >runs across two days, e.g. may start at 11:40 pm and may finish at 12:10 am.
>
> Take a look at the DateDiff() function in the VBA help. I believe it
> will work with TIMESTAMP values as well as Date/Time values but I'm
> not absolutely certain! It will give you a difference in your choice
> of units (from seconds to years) as an integer.
>
> I would strongly recommend that you NOT store the ELAPSED_TIME in any
> table field; it's redundant and can be calculated whenever it's
> needed.
>
> John W. Vinson[MVP]
> Join the online Access Chats
> Tuesday 11am EDT - Thursday 3:30pm EDT
> http://community.compuserve.com/msdevapps
>
- Next message: Brenda _at_ AIM: "importing different files"
- Previous message: Rick Brandt: "Re: Subtracting two fields in SQL syntax HELP"
- In reply to: John Vinson: "Re: Difference between two dates and times"
- Next in thread: Jamie Collins: "Re: Difference between two dates and times"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|