Question

Asked:
Asked By:
Sep 5 2008   5:11 PM GMT
Vidukarth   25 pts.

query of query errors


Java, ColdFusion, SQL Server 2000, SQL Server 2005, Java applications, ColdFusion 6.x, ColdFusion 8.x

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

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development and SQL Server.

Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Mrdenny   41270 pts.  |   Sep 9 2008  8:52AM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.