Hi all, I am trying to pull a min and max timestamp and then get the difference in days between the two. The dates are coming from a list of dates.. I have used the below statement, but it doesnt seem to work right.
$sql2 = "SELECT ((MAX(UNIX_TIMESTAMP(checked_in)) - MIN(UNIX_TIMESTAMP(checked_out)))/86400) AND checked_in != '00000000000000' FROM sometable WHERE someid = $someid";
My MIN checked_out timestamp is : 20041003152859
My MAX checked_in timestamp is: 20041008152859
They are 5 days appart exactly so the output should be 5 days, but it outputs 1.. Any ideas?