Welcome to WebmasterWorld Guest from 54.145.58.37

Forum Moderators: open

Message Too Old, No Replies

DateDiff function

     
8:18 pm on Oct 13, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 16, 2005
posts:40
votes: 0


i am trying to subtract two dates in the format
1/1/2005 13:45. I am trying to pull all records between two dates that the difference between the TimeIn(1/1/2005 15:00) and the TimeOut(1/2/2005 20:00) fields are > 3 hrs. i am using Access.
8:47 pm on Oct 13, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 1, 2002
posts:5199
votes: 0


Hi, don't know if this is any help, but I tried a DateDiff query on a table I have ..


SELECT *, TimeIn, TimeOut
FROM YourTable
WHERE ((DateDiff("h",[TimeIn],[TimeOut])>3));

the asterisk, would be replaced with the other fields you actually want if the asterisk is too much.. but I think you have to name your time in/out fields specifically.

Suzy

9:36 pm on Oct 13, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 16, 2005
posts:40
votes: 0


Thanks suzy, that code worked perfectly
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members