Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQl Server SQL statement equivlents

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello all,
I recently switched my active server pages from an Access 97 backend to a SQL server 7 backend . Yet now when I use this SQL statement :

strSQLQuery1 = "SELECT * FROM cocoitem WHERE CustNum = '" & strcustnum & "' AND (stat = 'O' OR stat = 'F') AND [due-date] > DateAdd('yyyy', -1, GETDATE()) Order By [cust-item], [due-date] ASC;"

I used to have the date() function before when I used Access 97 but changed it to GETDATE() when I went to SQl 7. Besides that everything is the same. Now I am getting an error like this:
Microsoft OLE DB Provider for SQL Server error '80040e14'

Invalid parameter 1 specified for dateadd.

/scripts/order/shippingstatsopen.asp, line 28


Does anyone know how to fix this?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top