Or try (datepart(MM,work_day), something like that. Basically your syntax is a 
bit off.

CC


----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.
----------------------------------------------------------------------------------------





"Bruce, Rodney S HQISEC/Veridian IT Services" <Rodney.Bruce
@HQISEC.ARMY.MIL>
07/22/2003 12:10 PM
Please respond to cf-talk

 
        To:     CF-Talk <[EMAIL PROTECTED]>
        cc: 
        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
                                

Reply via email to