bapkins
asked on
SQL Select all records 30 days prior
Hi All,
I am trying to create an sql select where query that will return all records that are 45 days old.
My date field is acocmp1.currsale.trandate
The current format for the date in that field is 2102-01-03 00:00:00
Cheers
I am trying to create an sql select where query that will return all records that are 45 days old.
My date field is acocmp1.currsale.trandate
The current format for the date in that field is 2102-01-03 00:00:00
Cheers
Try this
SELECT * FROM currsale WHERE (DATEDIFF(CURDATE(),tranda te) > 45)
SELECT * FROM currsale WHERE (DATEDIFF(CURDATE(),tranda
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could do:
SELECT * FROM table WHERE acocmp1.currsale.trandate > DATE_SUB(NOW(),INTERVAL 45 DAY)
SELECT * FROM table WHERE acocmp1.currsale.trandate > DATE_SUB(NOW(),INTERVAL 45 DAY)
ASKER