It is do-able, but it is difficult and resource intensive.  If you are using
SQL Server look at cursor, cross tab, and pivot table.

Tim Heald
ACP/CCFD :)
Application Development
www.schoollink.net

> -----Original Message-----
> From: Adrian Cesana [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 24, 2002 3:47 PM
> To: CF-Talk
> Subject: must be a better method
>
>
> Im generating a summary report but the current method Im using
> could result
> in up to 100 queries or more...so this is what Im trying to achieve.
>
> Basically dealing with two fields, Carrier and Date.  The user selects a
> date range, I need a count all the records for each day within the range
> grouping by the Carrier.  Currently I create a list of Carrier's then loop
> thru, within the loop I CFQUERY and get counts for each carrier for that
> single day (inner loop), well this results in tons of queries....and could
> potentially be really slow depending on the date range although I limit to
> 31 days.
>
> Output needs to look like this:
>
> CARRIER DATE1 DATE2 DATE3
> carr1       n n       n
> carr2         n       n       n
> carr3         n       n       n
> carr4         n       n       n
>
> Any recommendations on how to speed this up with perhaps a single
> query? and
> if thats possible how would I CFOUTPUT to get the above results.
>
> Thanks!
> Adrian
>
>
>
>
>
>
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to