RE: null query prob
It also looks like you're trying to access a SQL value in your CF code with . You can't mix things like this. Adrian -Original Message- From: Jerry Johnson [mailto:[EMAIL PROTECTED] Sent: 01 March 2006 15:27 To: CF-Talk Subject: Re: null query prob You are conditionally running the inner join, but you are always pulling the states variables. They both need to be conditional, I think On 3/1/06, Tim Laureska <[EMAIL PROTECTED]> wrote: > When I run this query I get sl_applicant is UNDEFINED. could someone > enlighten me :-) > > > > > > SELECT sl_applicant.*, states.* > > FROM sl_applicant > > INNER > JOIN states ON states.state_id=sl_applicant.state_hm > > > > > > thanks > > Tim ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233776 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: null query prob
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 queryif 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 :-) > > > > > > SELECT sl_applicant.*, states.* > > FROM sl_applicant > > INNER > JOIN states ON states.state_id=sl_applicant.state_hm > > > > > > 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
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 queryif 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 :-) > > > > > > SELECT sl_applicant.*, states.* > > FROM sl_applicant > > INNER > JOIN states ON states.state_id=sl_applicant.state_hm > > > > > > thanks > > Tim > > > > > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233754 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
Re: null query prob
You are conditionally running the inner join, but you are always pulling the states variables. They both need to be conditional, I think On 3/1/06, Tim Laureska <[EMAIL PROTECTED]> wrote: > When I run this query I get sl_applicant is UNDEFINED. could someone > enlighten me :-) > > > > > > SELECT sl_applicant.*, states.* > > FROM sl_applicant > > INNER > JOIN states ON states.state_id=sl_applicant.state_hm > > > > > > thanks > > Tim > > > > > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233749 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