Does anybody know the equivalent of this query in mssql:
SELECT * FROM myTable WHERE date_field = DATE_SUB('2003-10-19', INTERVAL 7
DAY);
For this project we are pulling records off a MS SQL db, and I need to
figure a way to return all records for the week.
Any help is appreciated.
--
Well, even if you don't find an alternative for that syntax, you could
always do the date subtraction in application space and make the query
like this:
SELECT * FROM myTable WHERE date_field = '2003-10-12'
- Gabriel
On Tuesday, October 21, 2003, at 05:49 PM, DevList wrote:
Does anybody
date_field = DATEADD(DAY, 7, '2003-10-19')
Dan
-Original Message-
From: DevList [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 4:49 PM
To: mySQL Mailing List
Subject: mysql to mssql query
Does anybody know the equivalent of this query in mssql:
SELECT * FROM myTable WHERE
Oops, you are subtracting the date, so use - 7 instead of + 7...
Dan
-Original Message-
From: Dan Lampkin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 5:05 PM
To: 'DevList'; 'mySQL Mailing List'
Subject: RE: mysql to mssql query
If I understand your question correctly