How can you get today's date and convert it to 01/mm /yyyy
format and get data from the table with delivery month 3 months ago? Table already contains delivery month as 01/mm/yyyy
.
How can you get today's date and convert it to 01/mm /yyyy
format and get data from the table with delivery month 3 months ago? Table already contains delivery month as 01/mm/yyyy
.
5条答案
按热度按时间dba5bblo1#
Mureinik's suggested method will return the same results, but doing it this way your query can benefit from any indexes on
Date_Column
.or you can check against last 90 days.
nwwlzxa72#
Latest Versions of mysql don't support DATEADD instead use the syntax
To get the last 3 months data use,
iezvtpos3#
I'd use
datediff
, and not care about format conversions:wqsoz72f4#
Last 3 months
Today
p5fdfcr15#
Last 3 months record