I just did this the other day.      

      <cfparam name="char" default="A">

      <cfquery name="" datasource="">
      Select * from ContactList where lname like '#char#%' order by
lname, fname
      </cfquery>

      <cfset alphaList =
"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">
      <cfoutput>
      <cfloop list="#alphalist#" delimiters="," index="Char">
      <font face="Arial" size="4"><a
href="contacts.cfm?char=#char#">#CHAR#</a></font>
      </cfloop>
      </cfoutput>

Misty

-----Original Message-----
From: schmidt [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 11:27 AM
To: cf-talk
Cc: schmidt
Subject: Re: Alphabetic List


You can do this in your SQL

SELECT People Info
WHERE LastName LIKE 'A%'

This would be for people with last names that start with A.

Kevin
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:13 AM
Subject: Alphabetic List


> Hi,
>
> In Yahoo address book, they have this list for finding a particular
> person easily
> by the first letter of their last name:
>
> 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
>
> Does anyone have any insights on how the algorithm of implementing
this
> feature?
>
> For example, I have a user database, and I want to use this feature to
> find
> persons whose last name start with a particular letter.
>
> 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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to