-
get hour differnce from 2 columns question
Hello Forums:
I need to get the hour difference from two columns in this table and insert it in hours_today column:

here's my query to get the difference in seconds
$q = mysql_query("SELECT UNIX_TIMESTAMP(s_out) - UNIX_TIMESTAMP(s_in) AS dif FROM sd_record WHERE id = 1");
Problem is how do I apply this arithmetic inside the query:
floor(dif / (60 * 60)) -> to convert seconds to hours
thnx
-
Nevermind head over to this thread :
http://www.sitepoint.com/forums/show...=1#post4587935
tnx to crmalibu
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks