OMG, I cant type. If the date portion of the string is always in the same position within the main string then use the substring command.
I feel much better. 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. ---------------------------------------------------------------------------------------- Casey C Cook/ASD/CSC @CSC 06/12/2003 04:54 PM Please respond to cf-talk To: CF-Talk <[EMAIL PROTECTED]> cc: Subject: RE: SQL conversion question for SQL Guru If the date fields are always in the same position within the string then use the subtring command. 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. ---------------------------------------------------------------------------------------- "Eric Creese" <ecreese @eaa.org> 06/12/2003 02:45 PM Please respond to cf-talk To: CF-Talk <[EMAIL PROTECTED]> cc: Subject: RE: SQL conversion question for SQL Guru The field actually holds different kids of data based on the record type. I am only select records that will contain a date -----Original Message----- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 4:44 PM To: CF-Talk Subject: Re: SQL conversion question for SQL Guru Eric Creese wrote: > I have a query I am trying to run to get a particular record out of the database. The problem is that one of the fields is > a varchar 255 field that houses a date. Only a date, or other information as well? > I want to convert the date so I can find out if it is greater than getdate(). I run the following > code and generate this conversion error message: > > Server: Msg 241, Level 16, State 1, Line 1 > Syntax error converting datetime from character string. > > > select distinct personid > from persondemographic > where demographicgroupid =4 > and demographicitemid =4 > and convert(datetime, demographicvaluedesc) > getdate() Which DBMS? Jochem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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