Add this line directly before your query.
<cfdump var="#url.alpha#" label="url.alpha">

This will show to the page what url.alpha is set to right before the query.
This method will allow you to verify that the data is correct.  As far as
the way that the queries are set up, they should work, which is why I
suggest troubleshooting for the variable value.

-- 
William E. Seiter
 
Have you ever read a book that changed your life?
Go to: www.winninginthemargins.com
Enter passkey: goldengrove
 
Web Developer / ColdFusion Programmer
http://William.Seiter.com
-----Original Message-----
From: Walter Conti [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 02, 2008 8:07 PM
To: CF-Newbie
Subject: Query-of-Query and MySQL

I need to select a field content by its first letter. The following works :

<cfquery name="data" dbtype="query">
   select * from session.usersData
   <cfif isDefined('url.alpha')>
      where username LIKE 'a%'
   </cfif>
   order by #sortKey# #sortOrder#       
</cfquery>

using var 'url.alpha' returns nothing and no error:

<cfquery name="data" dbtype="query">
   select * from session.usersData
   <cfif isDefined('url.alpha')>
      where username LIKE '#url.alpha#%'
   </cfif>
   order by #sortKey# #sortOrder#       
</cfquery>

Please advise. TIA 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3365
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to