<cfset S1 = Evaluate("qryGetSearchType1." & ColID1)>

That's how I'd write it.  Probably a number of ways to do it, but the main 
thing is you need to evaluate your string to get the value of it.

Dave

-----Original Message-----
From: Nick Sweeney [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 28, 2005 3:43 PM
To: CF-Newbie
Subject: Dynamic Query Trouble


Having trouble with a dynamic query - I think I have been staring at it too 
long... and have outstretched what little knowledge I have in these matters.

Essentially I do this:

<!--- Get the Search 1 --->
<cfquery name="qryGetSearchType1" datasource="#datasource#" 
username="#username#" password="#password#">
SELECT 
      #ColID1#
FROM
     #TableSearch1#
WHERE 
     #ColDesc1# = "#FORM.SearchValue1#"
</cfquery>

This Query Works just fine - the variable are sent from a dynamic Combo Box. 
(Found on this site http://www.mattkruse.com/javascript/dynamicoptionlist/)

And THEN - I need the result of the Query - which should only be ONE record. A 
Number!

And I am attempting to set it like:
<cfset S1 = "qryGetSearchType1.#ColID1#">

But that returns qryGetSearchType1.NationalID

Which as you know is NOT a Number.  

Help me Obe Wan Kenobes - your my only hope!

-Nick



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1354
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to