Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Computing time difference

Status
Not open for further replies.

mssbass

IS-IT--Management
Aug 24, 2001
53
0
0
US
I need help with creating a query which produces how many minutes or days difference there is between dates formatted as follows:

I need a query (no vba, etc.)

2003-10-07 10:30:00
 
Formatting doesn't matter. All dates are doubles internally.
Code:
Select DateDiff("n", [FirstDate], [SecondDate]) As [Minutes], ...
 
I can't get this to work. Do I just replace the firstdate and seconddate with my table names? what else do I do to this statement? I'm assuming this goes into the "build" area of my select query?

 
Not table names ... field names. I just used [FirstDate] and [SecondDate] as place holders for the two date fields that you said you had. If you're doing this in query design view rather than SQL view then define a field as
Code:
Minutes: DateDiff("n", myTable.[FirstDate], myTable.[SecondDate])
Where "myTable" is the name of the table containing the fields.
 
I need the difference in time to show # of days, hours and minutes left over between the 2 dates??
 
there are NUMEROUS tthreads in these fora with various soloutions. Use search / advanced search. Please use htese resources BEFORE asking (new) questions. It can save both you (the original poster) and the respondents (answerers) time and effort. Further, you may often get several variations on the theme and thus a choice of approaches,



MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top