RE: cfoutput lists Alphabetically

2001-04-13 Thread Ian MacFadyen
You also avoid all the looped queries and conditional code by writing 1 SQL query and grouping your cfoutput: CFQUERY NAME="directory" DATASOURCE="someds" SELECT lastname, firstname, LEFT(lastname, 1) AS letterindex FROM Directory_tbl ORDER BY letterindex,

RE: cfoutput lists Alphabetically

2001-04-12 Thread Simon Horwith
Try adding "ASCII(lastname) AS thesortkey" into your select clause, then group by thesortkey and order by lastname at the end of your where clause. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036

RE: cfoutput lists Alphabetically

2001-04-12 Thread Bruce, Rodney
this is one way. CFLOOP index="letter" list="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" delimiters="," CFQUERY name="list" datasource="database" dbtype="ODBC" SELECT table.fname, table.lname FROM table WHERE table.name Like

Re: cfoutput lists Alphabetically

2001-04-12 Thread Pooh Bear
in your SQL statement, do an ORDER BY For example, I want to sort by last name in alphabetical order, my SQL would be like SELECT FirstName, LastName, Address FROM ClientInfo Order By LastName From: Christine Kelley [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED]

RE: cfoutput lists Alphabetically

2001-04-12 Thread Bruce, Rodney
Oops, sorry ORDER BY table.name; should be: ORDER BY table.lname; Type O, lost the l :o) -Original Message- From: Christine Kelley [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 10:28 AM To: CF-Talk Subject: cfoutput lists Alphabetically Hi! How do I output a whole

RE: cfoutput lists Alphabetically

2001-04-12 Thread Dylan Bromby
in your query add: ORDER BY lastname ASC -Original Message- From: Christine Kelley [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 10:28 AM To: CF-Talk Subject: cfoutput lists Alphabetically Hi! How do I output a whole list of names from a query grouped

RE: cfoutput lists Alphabetically

2001-04-12 Thread Troy Hiltbrand
cfset Variables.InitialLetter="" cfoutput query="queryName" cfif InitialLetter is not LEFT(field,1) cfset Variables.InitialLetter= LEFT(field,1) #InitialLetter#br /cfif #field# /cfoutput -Original Message- From: Christine Kelley

Re: cfoutput lists Alphabetically

2001-04-12 Thread Dave Hannum
Do it in your SQL. ORDER BY LastNameColumn Then, do your group buy Dave - Original Message - From: "Christine Kelley" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Thursday, April 12, 2001 1:28 PM Subject: cfoutput lists Alphabetically Hi! How do I output a whole

RE: cfoutput lists Alphabetically

2001-04-12 Thread kmansel
This would be an order by statement in your SQL call... like so... cfquery name="info" datasource="yourdb" SELECT * FROM Customers ORDER BY LastName DESC /cfquery use that ORDER BY statement as a DESC - descending, or ASC ascending... hth kevin ~ Kevin Mansel Web Developer

RE: cfoutput lists Alphabetically

2001-04-12 Thread Hayes, David
Try something like this: SELECT LEFT(lastName,1) as Initial, lastname, firstname from myTable order by Initial, lastname Then you can use the grouping attribute on the Initial field. CFOUTPUT query="myquery" group="Initial" #initial# CFOUTPUT #lastname#, #firstName# /CFOUTPUT /CFOUTPUT

RE: cfoutput lists Alphabetically

2001-04-12 Thread Dylan Bromby
BR /CFIF #lastname#, #firstname# BR CFSET rem_letter = #Left(lastname, 1)# /CFOUTPUT -- -Original Message- From: Bruce, Rodney [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 10:44 AM To:

Re: cfoutput lists Alphabetically

2001-04-12 Thread Tim Painter
Try something like this: cfquery name="foo" datasource="bar" Select LEFT(Users, 1) AS abcOrder, UserFirstName, UserLastName From Users Order by abcorder /cfquery cfoutput query="foo" group="abcorder" #Ucase(abcOrder)#br ul cfoutput#UserLastName#, #UserFirstName#/cfoutput /ul /cfoutput -

RE: cfoutput lists Alphabetically

2001-04-12 Thread Peter Stolz
Try, CFQUERY NAME="q" DATASOURCE="#DSN#" SELECT *, SUBSTRING(lname,1,1) AS FirstLetter FROM MyTable ORDER BY FirstLetter /CFQUERY CFOUTPUT QUERY="q" GROUP="FirstLetter" #FirstLetter# CFOUTPUT #lname#, #fname# /CFOUTPUT /CFOUTPUT

RE: cfoutput lists Alphabetically

2001-04-12 Thread Christian L. Watt
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 12:53 PM To: CF-Talk Subject: RE: cfoutput lists Alphabetically This would be an order by statement in your SQL call... like so... cfquery name="info" datasource="yourdb" SELECT * FR