query of query errors

25 pts.
Tags:
ColdFusion
ColdFusion 6.x
ColdFusion 8.x
Java
Java applications
SQL Server 2000
SQL Server 2005
I have a runtime query of a query error as below. java.lang.String cannot be cast to java.util.Date But the output format is correct and is in date. This application was developed in coldfusion 6.1 and sqlserver2000. But now we get this error when it was migrated to coldfusion 8 and sql server 2005. Below is the query block. There error comes in the select statement. if (NOT IsDefined("URL.sOrderBy")) URL.sOrderBy = "dtStartDate"; if (NOT IsDefined("URL.sOrderType")) URL.sOrderType = "DESC"; </cfscript> <cftry> <!--- Query of a query ---> <cfquery name="Variables.qSearchProjects" dbtype="query"> SELECT * FROM qCombinedProjects ORDER BY #URL.sOrderBy# #URL.sOrderType#; </cfquery> <cfcatch> <!--- Order the projects by start date ---> <cfquery name="Variables.qSearchProjects" dbtype="query"> SELECT * FROM qCombinedProjects ORDER BY dtStartDate DESC; </cfquery> </cfcatch> </cftry> dtstartdate is in date format. Please help as this really urgent

Answer Wiki

Thanks. We'll let you know when a new response is added.

Sounds like you’ve got a string that you are trying to load the datetime data into a string value. I’m guessing that this is the problem, and the old version of ColdFusion didn’t mind the conversion, but the new version doesn’t like it.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following