I have a question about using GROUP in CFOUTPUT.

What I want to accomplish is:

1.  Select records for a certain range of period, and insert into SQL 
query to pull up matching records.  This is being done by passing 
variables, and it's working; the query named "recorddump" matches up 
DETAIL and HEADER records.  In this query, I have ORDER BY 
CONVERT(int, P.SERVICE_MONTH), CONVERT(int, P.SERVICE_DAY), 
P.STAFF_ID, P.GROUP_NAME.

The trick is that there are 5 foreign keys in the DETAIL table, being 
matched to HEADER table where there is just one record for each month 
for each staff member.  There are many records that will be entered 
by that staff member in DETAIL table.  I want to be able to generate 
a record of all records entered by all staff members in a location. 
So here's how it would look like:


Staff 1, Month 3
   Record 1, Day 1
   Record 2, Day 3

Staff 2, Month 3
   Record 1, Day 2

Staff 2, Month 4
   Record 1, Day 3
 
Staff 1, Month 5
   Record 1, Day 1
   Record 2, Day 4

I have:

<CFSET "RecordsReturned" = #reportdump.RecordCount#>
<CFIF #RecordsReturned# GT 0>
<CFOUTPUT QUERY="reportdump" GROUP=service_month>
<TABLE>
   header record info
</TABLE>

<CFOUTPUT GROUP="service_day">
   table containing info from DETAIL record

</CFOUTPUT>

<BR>
</CFOUTPUT>
<CFELSE
  No records match your criteria; please try again.
</CFIF>

But somehow, some DETAIL records are being assigned to the wrong 
HEADER records.

If you have suggestions about what I'm doing wrong and better ways to 
do this, I'd welcome this.  Please carbon-copy to my email address as 
well, since I'm on digest.  Thanks for your help.


Lola J. Lee
QRC Division of Macro International Inc.

work  -  [EMAIL PROTECTED]   http://www.qrc.com/
home  -  [EMAIL PROTECTED]   http://www.his.com/~lola/ljl.html
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to