I am trying to query on a field that is a varchar(255) but has date information. 

I get the following error:
Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.

My query:
select personid
from persondemographic 
where  convert(datetime,substring(demographicvaluedesc,1,11),101)> '06/30/2003'
and demographicgroupid =4
and demographicitemid = 4
and demographicvaluedesc is not null
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to