How do i calculate the difference between columns ( their datatype is DateTime

S

SUDHEER

I need someone help, we have table with 2 columns,

fieldname datatype
----------------------
stime date/time
etime date/time

I want to write a query that can display the stime-
etime.
Help wanted very urgent...
Mail me,if u have any solution to this
[email protected]
 
A

Allen Browne

You could do it with a calculated field using DMax().

For examle, this assumes you have filtered the query to the etime values,
and you want the number of minutes since the most recent stime:

Minutes: DateDiff("n", [etime], DMax("stime", "MyTable", "stime <= " &
Format([etime]), "\#mm\/dd\/yyyy\#"))
 
Top