> I think I didn't elaborate the question clearly.
>
> What I need is to output the list:
>
> All - 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 Z - Lists
>
> If there are persons last names start with "B", B should be a hot link.
> If there is no one's last name starts with "Q", Q is not clickable.

Do as Russell said for the query
<CFQUERY name="LetterList" datasource="myDNS">
        select distinct left(Surname,1) as Letter
        from myTable
</CFQUERY>

<cfset myLetters=ValueList(LetterList.Letter)>
<cfloop index="i" from=1 to=26>
        <cfset s=Chr(64+i)>
        <cfif ListFind(myLetters,s) gt 0>
                <a href="file.cfm?Letter=#s#">#s#</a>
        <cfelse>
                #s#
        </cfif>
</cfloop>

Should do it... but if you have thousands and thousands of records then you
don't want to do the SELECT like that... Oh, and index the field!

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 26 January 2001 16:42
> To: CF-Talk
> Subject: Re: Alphabetic List
>
>
> Thanks for your replies.
>
>
> Thanks!
>
> Hong
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to