SELECT DISTINCT(Left(your_column_name,1))
FROM your_table_name
WHERE your_clause

That should do it.


Joshua Miller
Head Programmer / IT Manager
Garrison Enterprises Inc.
www.garrisonenterprises.net
[EMAIL PROTECTED]
(704) 569-0801 ext. 254
 
************************************************************************
*************
Any views expressed in this message are those of the individual sender,
except where the sender states them to be the views of 
Garrison Enterprises Inc.
 
This e-mail is intended only for the individual or entity to which it is
addressed and contains information that is private and confidential. If
you are not the intended recipient you are hereby notified that any
dissemination, distribution or copying is strictly prohibited. If you 
have received this e-mail in error please delete it immediately and
advise us by return e-mail to [EMAIL PROTECTED]
************************************************************************
*************


-----Original Message-----
From: Jeff [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 29, 2003 10:16 AM
To: CF-Talk
Subject: Okay, what's the first part of those alphabetical navigation
strips?


Alright, the second part of it's easy enough to figure out, "select all
from table, where last_name starts with #letter# (passed from previous
page)"

But I've seen ones where the letters are links only if they have an
entry in the database. In other words, there's nobody with a last name
starting with X, so X isn't a link, but S is.

What's the secret to looping over your initial "select * from table"
query and seeing if there's an entry that starts with that letter?


A | B | C | D | E |
^   ^       ^

I think I'm feelin' it, but it's just not quite there.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Reply via email to