Answers for "sql query today minus 30 days"

SQL
2

sql server current date minus 5 years

SELECT GETDATE() 'Today', 
           DATEADD(day,-2,GETDATE()) 'Today - 2 Days'
SELECT GETDATE() 'Today', 
           DATEADD(dd,-2,GETDATE()) 'Today - 2 Days'
SELECT GETDATE() 'Today', 
           DATEADD(d,-2,GETDATE()) 'Today - 2 Days'
Posted by: Guest on May-28-2020
0

get data every 30 days in sql

SELECT * FROM product 
WHERE pdate BETWEEN datetime('now', '-30 days') AND datetime('now', 'localtime')
Posted by: Guest on May-13-2021

Code answers related to "sql query today minus 30 days"

Code answers related to "SQL"

Browse Popular Code Answers by Language