always seem to miss the simple stuff. removing the ' worked.
Thanks for the help Rodney -----Original Message----- From: Bruce, Rodney S HQISEC/Veridian IT Services [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 3:10 PM To: CF-Talk Subject: SQL help Hi all We are finally tring to upgrate from Access to SQL 2000. I am working on making the necessary changes to the queries. One I am having a problem with is were the WHERE statement is: WHERE (proj_name = '#Qgetinfo.proj_name# ') and(datepart('M',work_day) =#m#) m=number for the month: m=5. work_day is the field in the db table. this works fine with Access(data type date/time), but with SQL I get the error: Error Diagnostic Information ODBC Error Code = 37000 (Syntax error or access violation) [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid parameter 1 specified for datepart when the data type is smalldatetime and if I change it to timestamp, no error but no records are returned either. This is used to create a report based on the project selected and the month. THanks Rodney ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

