DateDiff

M

Mark A. Sam

Can anyone tell me the format for finding the numbers of seconds between
[Date1] and Time() ??

I looked in Help in A2000 and it had no info except a couple mediocre
examples. In A2002, you cannot even find the word datediff.

I'm puzzled.

God Bless,

Mark A. Sam
 
S

Steve Schapel

Mark,

Technically it is...
DateDiff("s",Time(),[Date1])

However, I am not really sure that this is what you want. If Date1 is
a date/time field that actually contains a current/recent date, your
DateDiff function will return a very large number of seconds. Because
in the absence of any Date information, the Time() function on its own
relates to Day 1, which is 31 December 1899.

If you still not getting it, please post back with an example of what
you are trying to do, and the expected result.

- Steve Schapel, Microsoft Access MVP
 
J

John Vinson

Can anyone tell me the format for finding the numbers of seconds between
[Date1] and Time() ??

I looked in Help in A2000 and it had no info except a couple mediocre
examples. In A2002, you cannot even find the word datediff.

You need to open the VBA editor in order to get (badly indexed, still,
alas... better in 2003 they say) help on the builtin functions.

You probably want

DateDiff("s", [Date1], Now())

if Date1 is filled with a date (midnight assumed) or date/time value
including a date portion; use Time() instead of Now() if Date1 is a
pure time (i.e. a double float number >= 0 and < 1 corresponding to a
time on December 30, 1899).
 
P

Peter R. Fletcher

Help certainly wasn't any better in the 2003 beta - indeed, there were
(IMHO) so few changes/improvements that I have not upgraded.

Can anyone tell me the format for finding the numbers of seconds between
[Date1] and Time() ??

I looked in Help in A2000 and it had no info except a couple mediocre
examples. In A2002, you cannot even find the word datediff.

You need to open the VBA editor in order to get (badly indexed, still,
alas... better in 2003 they say) help on the builtin functions.

You probably want

DateDiff("s", [Date1], Now())

if Date1 is filled with a date (midnight assumed) or date/time value
including a date portion; use Time() instead of Now() if Date1 is a
pure time (i.e. a double float number >= 0 and < 1 corresponding to a
time on December 30, 1899).
 

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


Top