Whatever message this page gives is out now! Go check it out!

QueryRecordCount

Last update:
May 18, 2026

Description

Calculates the number of rows in a query object.

Returns

The number of rows in a query.

Category

Syntax

QueryRecordCount(Object query)
Member functions
queryObject.RecordCount()

See also

History

ColdFusion (2018 release) Update 5: Added the function and the member function len().

Parameters

Parameter
Required/Optional
Description
query
Required
The query object whose rows are to be counted.

Example

<cfscript>
 myQuery1=queryNew("empid,depid,name", "integer,integer,varchar",[
    [10, 101, "John"],
    [20, 120, "James"],
    [30, 205, "Peter"]
    ]);
 writeoutput(QueryRecordCount(myQuery1)) // Returns 3
 writeoutput(myquery1.getRecordCount()) // Returns 3
 writeoutput(myquery1.len()) // Returns 3
 writeoutput(myquery1.RecordCount) // Returns 3
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page