Skip to main content
Participant
June 27, 2006
Answered

Query of Query Error

This is the error I get -
Query Of Queries syntax error. Encountered ". Query Of Queries runtime error.
The Cold Fusion server is running MX 7,0,1,116466.
The sql is "Select * from Invlotquery2 where lotnum = '2011-61-12' ". (The extra space after the single quote is for clarity.)
I have already built the query and the user is trying to filter on a lot number. Whenever the lot number starts as numeric and is 10 digits long(2011-61-12) the above error happens. A lotnumber thats starts as a character or a lot number that starts numeric and has less than 10 characters or more than 10 characters works ok. I still have code in place to create a dummy record for the query that sets the query fields up as characters. I found out that previous versions of Cold Fusion could create query fields as numeric if not specified.
This really seems to be a user specific error but I thought I would post here to see if anyone has had a similiar problem or knows of a solution.

Thanks,

Dale
This topic is closed to new replies. Start a new post to keep the conversation going.
Dan_BracukCorrect answer
Inspiring
June 27, 2006
My guess is that Cold Fusion is interpreting the lotnum field as a date instead of a string. To get around that, you might want to add an additional field to the select clause of your initial query that prepends a letter to the lot number. Then, in your Q of Q, use that field in your where clause.

10 replies

Inspiring
June 27, 2006
> My guess is that Cold Fusion is interpreting the lotnum field as a date instead
> of a string. To get around that, you might want to add an additional field to
> the select clause of your initial query that prepends a letter to the lot
> number. Then, in your Q of Q, use that field in your where clause.

*OR* just use a <cfqueryparam> to tell CF what date type it actually is
(probably a varchar). That way you don't need to mung your data.

--
Adam
Translate
driggleAuthor
Participant
June 29, 2006
Does a cfqueryparam work with a query of query?
<cfquery name="InvLotQuery2" dbtype="query">
#preserveSingleQuotes(tWhereClause)#
</cfquery>
Translate
driggleAuthor
Participant
June 27, 2006
That was it.

Thanks again.
Translate
Dan_BracukCorrect answer
Inspiring
June 27, 2006
My guess is that Cold Fusion is interpreting the lotnum field as a date instead of a string. To get around that, you might want to add an additional field to the select clause of your initial query that prepends a letter to the lot number. Then, in your Q of Q, use that field in your where clause.
Translate