time problem [message #4351] |
Sun, 01 December 2002 23:39 |
waseem
Messages: 6 Registered: May 2001
|
Junior Member |
|
|
hi
i stored the time in database field fromtime and totime.now how i get the difference between two time
in query when i run query
select fromtime-totime from timetable it give me .233 som thing.
any solution to this problm
|
|
|
Re: time problem [message #4354 is a reply to message #4351] |
Mon, 02 December 2002 00:27 |
Deepa
Messages: 269 Registered: November 2000
|
Senior Member |
|
|
if you do an ordinary subract on datetimes it will return the count of difference in no. of days.
I think you fromtime and totime falls on the same day and may be with difference in hours or minutes.That's why it gives a decimal answer
If you want the difference in hours give
select (fromtime-totime)*24 from timetable
If you want in minutes give
select (fromtime-totime)*24*60 from timetable
|
|
|