House of Fusion
Home of the ColdFusion Community

Search cf-talk

December 02, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

Query of Queries error

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
vidya yegnaraman
09/05/2008 12:40 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
09/05/2008 06:00 PM

i had a similar problem and turned out to be that one of the values in the order by clause was empty - cf seems to mistake it for a empty string and therefore was producing the same error you are experiencing... check all values in the problem column to ensure there are no empty values i also get around alot of query of query problems by using cast() hope this helps ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists