Thanks Jim... that was the ticket..... I always forget about the
left/right joins !

Tim 




-----Original Message-----
From: Jim Wright [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 01, 2006 10:41 AM
To: CF-Talk
Subject: Re: null query prob

You are doing a cfif on the table sl_applicant...which is not a
variable defined in the ColdFusion context...that is part of your
query....if you want to pull back all records, whether or not
sl_applicant.state_hm is NULL, do a left join...

SELECT sl_applicant.*, states.*
FROM sl_applicant LEFT JOIN states ON
states.state_id=sl_applicant.state_hm

On 3/1/06, Tim Laureska <[EMAIL PROTECTED]> wrote:
> When I run this query I get sl_applicant is UNDEFINED. could someone
> enlighten me :-)
>
>
>
> <cfquery datasource="#datasource#" name="appl_info">
>
> SELECT sl_applicant.*, states.*
>
> FROM sl_applicant
>
>                         <cfif sl_applicant.state_hm IS NOT NULL>INNER
> JOIN states ON states.state_id=sl_applicant.state_hm</cfif>
>
> </cfquery>
>
>
>
> thanks
>
> Tim
>
>
>
>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233759
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to