You cant loop through letters
you will have to loop through the letters as a list
<cfset aplha = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,X">
<cfloop list="#Alpha#" index="i">
<a href="filename.cfm?Initial=#i#">link</a>
<CFQUERY NAME="GetInit" DATASOURCE="CIS">
SELECT DISTINCT Sur
FROM Customer
WHERE Left(Sur,1) = '#i#'
ORDER BY Sur
</CFQUERY>
</cfloop>
Regards
Steve Onnis
Domain Concept Designs
+61 422 337 685
+61 3 9444 7504
http://www.domainconceptdesigns.com <http://www.domainconceptdesigns.com>
("If you think it can't be done, you haven't asked me!") - Steve Onnis
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Andrew
Dickinson
Sent: Monday, March 17, 2003 4:18 PM
To: CFAussie Mailing List
Subject: [cfaussie] Parsing and looping text
Hopefully this will be easy.
I'm looking to do the following three tasks :
1. Loop through the alphabet, like this
<cfloop INDEX=X FROM='A' TO='Z'>
(but of course index doesn't do this)
2. Parse a letter/string as a parameter e.g.
<a href=filename.cfm?Initial='A'>link</a>
3. Parse an initial into an SQL statement
e.g.
<CFQUERY NAME="GetInit" DATASOURCE="CIS">
SELECT DISTINCT Sur
FROM Customer
WHERE Left(Sur,1) = '#Init#'
ORDER BY Sur
</CFQUERY>
... where Init is a single letter.
I'm puzzled that this query works in Access but not in CF.
Briefly, what I am trying to achieve is the following........
Generate a full alphabetic list, with links, leading to ...........
List of customer surnames starting with each letter, with links, leading
to .......
List of customers all of the same surname.
If anyone thinks I'm wildly offtrack, can you suggest a better approach ?
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/