SQL script to find last 14 days of records
Posted on 2009-02-23
I'm trying to return the last 14days of records. The date field in the system is in char type format, looks like yyyymmdd0000. I can not modify database, only run queries.
here's one example of what I 've tried
ASCIdatetime < (Day, -14, GETDATE()) or ASCIdatetime = GetDate()
but get a date conversion error.
I tried converting it to different datetime format first but just get the new field as same information, example CONVERT(char(20),ascidatetime, 101) as 'Date'.