MySQL Forums
Forum List  »  Newbie

Re: Please i need help on mysql on how to get last dates base on DATETIME
Posted by: Peter Brawley
Date: January 12, 2015 04:11PM

Assuming a timestamp or datetime named dt ...

... where dt >= subdate( dt, interval '12' hour ) ... -- within last 12 hrs
... where dt >= subdate( dt, interval '1' day ) ... -- within last 1 day

...etc...

Options: ReplyQuote


Subject
Written By
Posted
Re: Please i need help on mysql on how to get last dates base on DATETIME
January 12, 2015 04:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.