I have the following in file1.cfm:
query1 - uses a datasource
query2 - uses dbtype="query" and uses "from query1" in the select statement.
I have a functions.cfm file.
In it I have the following:
<cffunction name=x returntype="string">
<cfargument name=tn type="numeric">
<cfquery name="query4" dbtype="query">
select * from query2 where z = "#tn#"
More stuff to do calculations and return a value down here
From file1, if I call the function with #x(query2.tn)#, it seems that query2 is not being recognized in the cffunction x.
What do I need to do to make this type of scenerio work?