List:General Discussion« Previous MessageNext Message »
From:Barry Date:June 18 1999 1:57am
Subject:Select using time differences
View as plain text  

I could not find how to calculate the time difference between NOW() and a
TimeStamp column using the Date Time Functions listed in the docs. I am
using the latest NT version of mysql.

I would like to do the following Select (only correctly, of course :) )

where: TSVal is a TimeStamp column in my table

Select * from .... where Now() - TSVal <= 24 hours

  (24 hours or 1440 minutes or 86400 seconds)

suppose Now() is June 17 1999  20:30:00
        TSVal is June 16 1999  11:30:00

The difference is 118800 seconds (if I did the math correctly :) ), so my
Select would not return the row.

Any suggestions or pointers.

Thanks much,

db queries suddenly slowed downDavid Johnson18 Jun
  • Select using time differencesBarry18 Jun
    • RE: Select using time differencesDon Read18 Jun
  • Re: db queries suddenly slowed downSasha Pachev18 Jun
  • Re: db queries suddenly slowed downIlya Obshadko19 Jun