Chris,

Try using an "Order By" in your SQL in the query after the WHERE
statement:

<CFQUERY NAME="bid_package_results" DATASOURCE="scbuild">
SELECT      contractors.company_name as company, contractors.city,
bid_results.price, bid_results.project_id, bid_packages.label
as package
FROM         bid_packages, contractors, bid_results
WHERE       bid_packages.package_id = bid_results.package_id AND
                   contractors.contractor_id = bid_results.bid_id AND
                   (bid_results.project_id = #form.project_result#)
ORDER BY Price
</CFQUERY>

See if that works.

Chris Montgomery               [EMAIL PROTECTED]
:: Web development/Consulting  http://www.astutia.com ::
:: Allaire Consulting Partner/ NetObjects Reseller    ::
:: 210-490-3249/888-745-7603   Fax 210-490-4692       ::
:: Find a Job in San Antonio   http://www.sajobnet.com::


>-----Original Message-----
>From: Chris Giminez [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, June 20, 2000 7:53 PM
>To: [EMAIL PROTECTED]
>Subject: combining order by and cf group attribute
>
>
>I'm joining a few tables and grouping them by their "package". It works
>great until I try to add an ORDER BY price statement to the sql.
>When I do that, it creates several groups. The pricing order takes
>precedence over the grouping done in CF. How can I order by
>price and stay
>within the groups?
>
>thanks!
>______________________________
>
><CFQUERY NAME="bid_package_results" DATASOURCE="scbuild">
>SELECT      contractors.company_name as company, contractors.city,
>bid_results.price, bid_results.project_id, bid_packages.label
>as package
>FROM         bid_packages, contractors, bid_results
>WHERE       bid_packages.package_id = bid_results.package_id AND
>                   contractors.contractor_id = bid_results.bid_id AND
>                   (bid_results.project_id = #form.project_result#)
>
></CFQUERY>
>
>
>
><cfoutput query="bid_package_results" group="package">
>
><tr><th align="left">#package#</th></tr>
><cfoutput>
><tr><td>#company#</td><td>#city#</td><td>#price#</td></tr>
>
></cfoutput>
>
>
></cfoutput>
>
>
>--
>
>
>Chris Giminez
>Owner - Cyber Scriber Web Site Design
>831-728-4469
>ICQ# 2628000

------------------------------------------------------------------------------
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