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
                                

Reply via email to