Keep in mind that DateDiff works with the number of time-interval boundaries crossed between two times. It doesn't actually subtract the two.
That is,
[tt]DateDiff("m", starttime, endttime)[/tt]
will give different results than
[tt]DateDiff("m", 0, endtime-starttime)[/tt]
For the first way, the difference between 12:00:59 and 12:01:00 is 1 (a minute boundary has been crossed). The second way, the difference is 0 (less than a minute has elapsed).
You are using seconds, so the point may be moot here, but if you switch to a database such as SQL Server which stores datetime values with a resolution of 1/300th of a second you'd find your DateDiff function suddenly behaving differently.
Just like the Access example with minutes above, in SQL Server,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.