This is the scenerio,

I have two tables 1) master_table (x) which contain and emp_id and emp_name.
second table (y- emp_dept_table) contains the which contains emp_id, 
emp_name, etc..
I use the value from the form to do a search from x table, retreive the id 
and use the id to do a search in the y table for the emp record. But I 
cannot use the variables from the first query in the second query..

The idea is for the first search.cfm page to have a form

<cfform name="search" method="post" action ="test1.cfm">
                                <cfinput type="text" name="search">
                                <input type="SUBMIT" value="go">
                                </cfform>
and when the user submits the form, it goes to test1.cfm

in test1.cfm

there is query
<cfset search_criteria ="#FORM.search#">

                                <cfquery name = "SEARCH_QUERY" datasource="MYTEST" 
dbtype="ODBC">
                                SELECT *
                                FROM x where emp_name LIKE '#search_criteria#%'
                                </cfquery>

I use this query to get the emp_id and then use another query to search the 
the y table but I cannot use the following code as the #emp_id# is from the 
cfquery "SEARCH_QUERY" , how do I resolve this problem...

<cfquery name = "SEARCH_EMP_DEPT" datasource="MYTEST" dbtype="ODBC">
                                SELECT *
                                FROM y where #emp_id# LIKE '#search_criteria#%'
                                </cfquery>
Thanks Guys...
AD



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to