At 2:45 PM -0800 11/25/01, Mark Rissmann wrote:
>Can anybody out there give me a helping hand?
>I have a table of the following format
>UserId LoginDate(datetime) LogoutDate(datetime)
>1 2001-11-25 11:00:00 2001-11-25 13:45:00
>2 2001-11-26 22:25:00 2001-11-27 02:00:00
>I want to write a query that will calculate the hours worked for each
>record and then sum them up?
Convert each of them to seconds since the epoch (beginning of 1970),
take the difference to get number of seconds worked. Divide by the
appropriate value, e.g., 60 to get minutes worked.
>This is going directly to a report engine so I have little control over
>it (like running multiple queries) except I am able to manipulate the
>final value and format it.
>Thanks for any help.