Thursday, June 09, 2005

How Can I Change CFLOOP To Count ON Ordered Alpha Fields

I need to do a loop not by the primary key field, but by an alpha field. But ordering the query as below still results in a order by the numerical ID field.

How can I change the cfloop to do a count on the ordered alpha fields?

<cfquery name="checksector" datasource="dbname">
SELECT *
FROM sectors
ORDER BY sector
</cfquery>

<cfloop index = "LoopCount" from = "1" to = "#checksector.recordcount#">

0 Comments:

Post a Comment

<< Home