I need to create a sql query to find the difference between 'time in' and 'time out' of a building... but unfortunately both the times are stored in the same field. I can't change the database design because it is propritary. The backend database is SQL and the fields I am working with are...
Who
Where
When
and sample records are...
Joe Smith Main Office In 10/11/2004 08:00:00
Joe Smith Main Office Out 10/11/2004 17:00:00
Joe Smith Main Office In 10/12/2004 08:25:00
Joe Smith Main Office Out 10/12/2004 15:00:00
I figured out how to do this if I export the data to Excel, I can just write a formula to subtract the time in the previous records. But I can't figure out how to do it in sql. I would appreciate any help anyone can offer... this is probably easy for someone but I'm not having any luck.
Thanks in advance...
Who
Where
When
and sample records are...
Joe Smith Main Office In 10/11/2004 08:00:00
Joe Smith Main Office Out 10/11/2004 17:00:00
Joe Smith Main Office In 10/12/2004 08:25:00
Joe Smith Main Office Out 10/12/2004 15:00:00
I figured out how to do this if I export the data to Excel, I can just write a formula to subtract the time in the previous records. But I can't figure out how to do it in sql. I would appreciate any help anyone can offer... this is probably easy for someone but I'm not having any luck.
Thanks in advance...