you can add a count(field) as field_count however using this analytic function will force you to use a group by in your query, thus possibly messing with output. You'd have to use an aggregate function. Here we use an Oracle database, for this I'd do something like Select npa || nxx npanxx, count(npa) over () as npa_count from phone_numbers ....
You might want to see if you can use an aggregate function like that.. It might actually be best to use a separate query though. Good luck On Fri, 17 Dec 2004 13:05:06 -0500, Tim Laureska <[EMAIL PROTECTED]> wrote: > Thanks Anthony... but where is that any different from just doing > another query such as ... > > <cfquery dsn="whatever" name="count"> > SELECT field > FROM table > WHERE Field NEQ "" OR field NEW NULL > </cfquery> > > <cfoutput>#count.recordcount#</cfoutput> > > maybe just hopeful dreaming... > > > -----Original Message----- > From: Anthony Cooper [mailto:[EMAIL PROTECTED] > Sent: Friday, December 17, 2004 12:37 PM > To: CF-Talk > Subject: Re: record count > > If I understand you correctly, you have already run the query in a > <cfquery/> tag and have a recordset, no? > > If so, you could do a simple Query of Queries on this to further > interrogate your results. > > e.g. > > <cfquery name="rsNew" dbtype="query"> > SELECT COUNT( something ) AS somethingCount > FROM rsExisting > WHERE NOT something IS NULL > </cfquery> > > Where 'rsExisting' is the name of your original recordset. > > HTH, > Ant > > On 17 Dec 2004, at 17:28, Tim Laureska wrote: > > > I'm looking for a way of obtaining a count of records from a query > > where > > only one particular field has data... > > > > I don't want to create a separate query for this just addressing this > > field (ie. do recordcount where field NEQ "" or some variation) but > > would like to utilize an existing query that includes that particular > > field already in the select statement (among many others) > > > > Is there an easy way to get a count of records obtained by a query > > where > > data is in a field I'm interested in > > > > Hope that makes sense > > > > Tim > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Silver Sponsor - RUWebby http://www.ruwebby.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188033 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

