Skip to main content
Participant
November 19, 2007
Question

Complex object type to simple

  • November 19, 2007
  • 3 replies
  • 455 views
Hello.
The cfif doenst work, cause query is a complex type.
But the result of count query is numeric.
How can I convert the complexe type to an int?
Regards, Philipp

This topic has been closed for replies.

3 replies

Inspiring
November 19, 2007
"exists" is a query object (ie complex). You need to test the column value returned by the query instead. You cannot use RecordCount here because it will be > 0 due to the usage of COUNT().

<cfif exists.kfis GT 0 > ... </cfif>
Inspiring
November 19, 2007
In addition to Dan's suggestion, I also think you will have better results if you specified an actual DB column in the COUNT function - many DBMS will not even allow a wildcard in functions, and if it is working then you are getting a count for every column which would likely be returned as a comma delimited list and NOT actually a numeric value, hence why it becomes a complex value.



Inspiring
November 19, 2007
Use the recordcount attribute of cfquery.