>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#'
>
>
Greg:

Here is my revised query:

<cfquery name="rep" datasource="3iReps">
SELECT *
FROM RepFinder_Ext
LEFT OUTER JOIN RepFinder_Basic
ON RepFinder_Ext.RepId = RepFinder_Basic.RepId 
WHERE ('#FORM.zip#'#chr(62)#=BegZip) and ('#form.zip#'#chr(60)#=EndZip)
</cfquery>

My issue is this:  

It is returning the wrong result.  If I just do the first query above on a 
single table, it all works great.  It is when I do the join, that it hits the 
snag, and returns the wrong result.  The only field the tables have in common 
is RepId (which is being used in the join).  

Basically, what it is doing is this:  a one field form where you enter in your 
zip code.  Based off of whatever you enter in, it is returning the result (I am 
not sure about what #chr(62)# and #chr(60)# do) that falls between a range.
>
>
>
>
>
>On 2/21/07, John Eubanks <[EMAIL PROTECTED]> wrote:
>>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/

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