Time/Date Queries

  • Thread starter Thread starter Harold via AccessMonster.com
  • Start date Start date
H

Harold via AccessMonster.com

Hi, Im trying to make a query that deturmines the differance between two
date/time fields. The fields are DateOS, TimeOS, DateIS, TimeIS. I've
separated the time date fields in order to make entry easier. I will add
these together before finding the differance, ie. [DateOS] + [TimeOS] and
[DateIS] + [TimeIS]. Maybe something like this: Datediff ([DateOS] + [TimeOS])
([DateIS] + [TimeIS]). Also, after I find the differance between the dates I
need to sort by that differance, largest differance in time to smallest.

Thanks,
Harold
 
Try:
Datediff ("s", [DateOS] + [TimeOS], [DateIS] + [TimeIS])

That should return the nubmer of seconds difference between the 2 values, so
you can sort by them.

It may not work correctly for dates before 1900.
 
Apparently you have already discovered the DateDiff() function. Check Help
for the exact syntax.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top