Home Forums SQL Server 2008 SQL Server Newbies Extract only the last three days RE: Extract only the last three days
Andrew G
SSChampion
Points: 12809
More actions
March 5, 2013 at 3:35 am
#1593364
Painful dealing with dates stored as strings..
You'll have to use the same method as the YEAR query.
SELECT *
FROM tbl
WHERE CAST(SUBSTRING([myDateString], 1, 10) AS DATETIME) >= DATEADD(d, -3, getdate());