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
Actually, adjusting my previous code to make it
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,
you can use a LIKE '#letter#%' or depending on your DB
use a subscript function
[EMAIL PROTECTED] wrote:
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 -
A real easy way would be too.
Make a field to store the first letter of the last name.
Grab the first letter, save it to that field, index the field
since you will be searching on it.
Then
SELECT fields
FROM Users
WHERE letter = 'A'
Voila, very quick and effecient.
You can even just add
Do a Query on
SELECT *
FROMDBTable
WHERE LastName LIKE "A%"
You will get all the records which last name start with "A".
Regards,
Cecilia M. Lam
Ektron, Inc.
http://www.ektron.com
[EMAIL PROTECTED]
603-594-2350 ext 211
-Original Message-
From: [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
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
CFQUERY ...
SELECT ID,LastName,Address,etc...
FROM Orgs
WHERE LastName LIKE '#alpha#%'
/CFQUERY
where the value of alpha is one of the letters of the alphabet
best, paul
At 11:13 AM 1/26/01 -0500, you wrote:
Hi,
In Yahoo address book, they have this list for finding a particular
person
]]
Sent: Friday, January 26, 2001 12:27 PM
To: CF-Talk
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&qu
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
Well, "all" is easy... but if you click, say, "B", on the next page,
SELECT *
FROM Users
WHERE LastName LIKE 'B%'
That should get you all the records where LastName starts with B. Naturally
you'll put in a variable in your query...
WHERE LastName LIKE '#initial#%'
--Scott
- Original
select whatever
from userdatabase
where
lastname like 'A%'
will give you everyone who's last name starts with 'A'.
Regards,
Thomas C.
Office: 01565 757 909
This space for rent
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 26 January 2001
Thanks for your replies.
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
I would start by coding it this way.
The select statement to create the letters would be:
SELECT DISTINCT upper(left(LastName, 1))
FROM Name
ORDER BY upper(left(LastName, 1))
Then I would look through the resulting query to create the actual links.
The HREF for each letter would have a URL
-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
What would you suggest ?? :-)
Justin
-Original Message-
From: Jeremy Allen [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 4:36 PM
To: CF-Talk
Subject: RE: Alphabetic List
I would recommend against using this method
even if the field is indexed as this causes a
full table
ECTED]]
Sent: Friday, January 26, 2001 11:42 AM
To: CF-Talk
Subject: Re: Alphabetic List
Thanks for your replies.
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 nam
Are all the records on the same page or do you want them to go to a seperate
page for each listing
- Original Message -
From: [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, January 26, 2001 10:41 AM
Subject: Re: Alphabetic List
Thanks for your replies.
query="getlastnames"
a href="blah"#lastInit#
/cfoutput
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 11:42 AM
To: CF-Talk
Subject: Re: Alphabetic List
Thanks for your replies.
I think I didn't elab
ing on
A to Z, do a ListFind on your app variable to see if that letter shows up.
- Original Message -
From: [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, January 26, 2001 9:41 AM
Subject: Re: Alphabetic List
Thanks for your replies.
I think I didn't elaborat
Grr... I just saw Russel's reply and had completely glossed over the
DISTINCT idea... that would alleviate the 'too dang big valuelist result'
issue :)
--Scott
~~
Structure your ColdFusion code with Fusebox. Get the official book at
t the rest of the letters AFTER the last one in the query
---
cfoutput
cfloop condition="letter LT 91"
#chr(letter)#cfset letter=letter+1
/cfloop
/cfoutput
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 11:42 AM
To: C
lastname, 1)#)
/cfif
/cfif
/cfoutput
cfoutput
cfloop list="#alphalist#" index="i"
a href="page.cfm?alpha=#i#"#i#/a
/cfloop
/cfoutput
Good luck,
Nathan
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: F
PROTECTED]'
Subject: RE: Alphabetic List
Here's some code that does it. If you care about what the source looks
like, take the CR/LF out of the source loops. Even has comments ;)
!--- Query the DB ---
cfquery name="t1" datasource="ds" dbtype="ODBC"
select distinct
al 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 PROTECTE
as it is used a lot and as the table
grows in size.
Jeremy Allen
elliptIQ Inc.
-Original Message-
From: Kevin Schmidt [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 12:27 PM
To: CF-Talk
Subject: Re: Alphabetic List
You can do this in your SQL
SELECT People Info
WHERE
You mean something like:
DIV ALIGN=centerTABLE BORDER=0 CELLSPACING=0 CELLPADDING=8 WIDTH=600
TRTD ALIGN=leftBFONT face=Arial SIZE=-1Click a letter to list
Yellow Page Headings that begin with it:BRA
then you just display
the letter and no link... :)
Jeremy Allen
elliptIQ Inc.
-Original Message-
From: JustinMacCarthy [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 12:28 PM
To: CF-Talk
Subject: RE: Alphabetic List
What would you suggest ?? :-)
Justin
-Original Message
ginal Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 10:42
To: CF-Talk
Subject: Re: Alphabetic List
Thanks for your replies.
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
ut
!--- Now print out the rest of the letters AFTER the last one in the query
---
cfoutput
cfloop condition="letter LT 91"
#chr(letter)#cfset letter=letter+1
/cfloop
/cfoutput
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001
-Talk
Subject: Re: Alphabetic List
You mean something like:
DIV ALIGN=centerTABLE BORDER=0 CELLSPACING=0 CELLPADDING=8 WIDTH=600
TRTD ALIGN=leftBFONT face=Arial SIZE=-1Click a letter to list
Yellow Page Headings that begin with it:BRA
HREF=/HL/index.cfm/IN.CFOUTPUT#VARIABLES.INIT#/CD.#URL.CFI#/CN
This is not as fast as:
WHERE lname LIKE 'A%'
when the "lname" column is indexed.
best, paul
At 01:53 PM 1/26/01 -0500, you wrote:
Or do a query and on the last name field
do where lname = Lower(Left(LName, 1)) = 'letter'
~~
Structure your
31 matches
Mail list logo