3 Replies Latest reply on Jan 4, 2013 12:14 AM by BKBK

    IsQuery

    community help Level 1
        • 1. Re:  IsQuery
          mrs_temple

          IsQuery will return true even if there are zero records in the record count.

          • 2. Re:  IsQuery
            WolfShade Level 4

            Yes, all IsQuery does is check to see if the object is a query, or not (boolean).  Even if there are no records returned, a query is still a query.

             

            If you want to check to see if a query has more than 0 records in it, use <cfif queryName.recordCount gt 0></cfif>

             

            ^_^

            • 3. Re:  IsQuery
              BKBK Adobe Community Professional & MVP

              mrs_temple wrote:

               

              IsQuery will return true even if there are zero records in the record count.

              It is not the records which make a query a query. It is the two-dimenstional structure which ColdFusion creates to hold the records. To compare, an empty HTML table is still a a table.

               

              Use the test:

              if isQuery(myQuery) and myQuery.recordcount gt 0