Please take it easy on me as I am still quite novice at SQL. I have a SQL Server database in which I have a field DATE_CREATED. What I am trying to do is select all fields that have a DATE_CREATED value within the last two months. This is my SQL statement:
SELECT * FROM tbl_group
WHERE DATE_CREATED >= ('now'::datetime - '2 months'::timespan)
I read somewhere that timespan is fairly robust in that it recognizes phrases such as '2 months,' '12 hours,' etc. I get an error near one of the colons. Any help would be greatly appreciated.
Thanks,
Patrick
SELECT * FROM tbl_group
WHERE DATE_CREATED >= ('now'::datetime - '2 months'::timespan)
I read somewhere that timespan is fairly robust in that it recognizes phrases such as '2 months,' '12 hours,' etc. I get an error near one of the colons. Any help would be greatly appreciated.
Thanks,
Patrick