Use a join statement..
But first redo your queries...
select foo, goo from my_table
where foo = '#form.foo#'

You're are too difficult to read..

Anyways use a join
select *
from foo f
left outer join goo g on f.id = g.id
where f.low = '#form.low#'
and f.high = '#form.high#'







On 2/21/07, John Eubanks <[EMAIL PROTECTED]> wrote:
> I have the following two sql statements:
>
> 1)
>
> <CFQUERY DATASOURCE="usreps" Name="rep">
> SELECT low, high, name, phone, ext
> From rep_salesreps
> WHERE ('#FORM.zip#'#chr(62)#=low) and ('#form.zip#'#chr(60)#=high)
> </CFQUERY>
>
> This one works fine as is.
>
> However, I need to get this second one to do the same thing, just against two 
> tables:
>
> 2)
>
> <cfquery name="rep" datasource="usreps_new">
> SELECT RepFinder_Basic.*,RepFinder_Ext.*
> FROM RepFinder_Basic,RepFinder_Ext
> WHERE ('#FORM.zip#'#chr(62)#=BegZip) and ('#form.zip#'#chr(60)#=EndZip)
> </cfquery>
>
> Any suggestions?
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2579
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