> 1. <CFQUERY NAME="p_swap" DATASOURCE="ccmast">
> SELECT      dbo.nxsprodr.prod_desc, dbo.nxsprodr.prod_code
> FROM         dbo.nxsprodr, dbo.nxsregir
> WHERE       dbo.nxsprodr.prod_code = dbo.nxsregir.prod_id
> </CFQUERY>
>
> 2. <CFQUERY NAME="software" DATASOURCE="ccmast">
> SELECT *
> FROM dbo.nxsregir
> WHERE  cust_code = #Cookie.User_Id#
> </CFQUERY>
>
> In the FIRST query above when I go to output the results of
> this join... How would I reference the columns ?
>
> Especially when I want to do a comparison up against the
> second query ?
>
> <cfif #p_swap.dbo.nxsprodr.prod_code# = #software.prod_id#>
> #p_swap.dbo.nxsprodr.prod_desc#
> <cfelse>
> UPDATE
> </cfif>
>
> If I do the above I get an error telling me that the column
> dbo.nxsprodr.prod_desc does not exist in the query p_swap.
>
> What am I doing wrong ?

CF doesn't know anything about the tables from which the fields came. You'll
have to reference your fields using the query name as the prefix, rather
than the table name:

p_swap.prod_desc
p_swap.prod_code
software.prod_desc

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
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