First off, there is no point in grouping your sql query by all the fields.
This does nothing, and remember that there is a very big difference when you
use grouping in sql then when you use grouping in cold fusion. I'll let you
look into the sql group, but here is how i would use a cold fusion grouping
to get the display you want:
<CFQUERY NAME="getmodels" DATASOURCE="#dsn#">
SELECT ANCAPID, model, make
FROM ANCAPCrashTests
ORDER BY Make, model, ancapid
</query>
<cfoutput query="getmodels" group="make">
#Make#
<cfoutput>
#model# - #ancapid#
<cfoutput>
</cfoutput>
Rick
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Michael Kear
Sent: Monday, November 13, 2000 7:37 PM
To: CF-Talk
Subject: CFLOOP has me stumped again.
I'm sorry if this is a very elementary CFLOOP question, but perhaps I've
been looking at this one so long now I can't see the wood for the trees so
to speak.
I have a query that gives me Make, Model and ID of a range of cars. I
want to display them on the page as follows:
make1 model 1-1
model 1-2
model 1-3
model 1-4
make2 model 2-1
model 2-2
model 2-3
make3 model 3-1
model 3-2
etc
In other words grouped by the car manufacturer, with each manufacturer's
models in sequence.
My SQL query is:
<CFQUERY NAME="getmodels" DATASOURCE="#dsn#">
SELECT ANCAPID, model, make
FROM ANCAPCrashTests
GROUP BY ancapid, model, make
ORDER BY Make, model, ancapid
</query>
So I believe the way I display the data is using CFLOOP but I'm dashed if
I can work out what I have to do with CFLOOP to give me the result I need.
Anyone? please?
Cheers,
Mike Kear
Windsor, NSW, Australia
Australian Consumers Assoc
http://www.choice.com.au
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]