Thanks for the feedback, John.
I'm not sure what was wrong with that query.
The line throwing the error worked when I had the queries
separated, before I tried a left join.
Separating them again worked after I changed this line:
where substring_index(p.mls_number, '_', 1) = oh.mls_number
to this:
where oh.mls_number = substring_index('#qGetAllBrokerProperties.mls_number#',
'_', 1)
Running two queries, I was looping qGetAllBrokerProperties
and then running qGetAllOpenHouses inside that loop.
Results are correct now.
Thanks, again!
Rick
-----Original Message-----
From: John M Bliss [mailto:[email protected]]
Sent: Tuesday, March 05, 2013 11:56 AM
To: cf-talk
Subject: Re: Anyone see anything wrong with the syntax of the query?
Perhaps it's the contents on that variable? Try putting it into a
cfqueryparam.
On Tue, Mar 5, 2013 at 10:47 AM, Rick Faircloth <[email protected]>wrote:
>
> <cfquery name = "qGetAllPropertiesAndOpenHouses"
> datasource="#arguments.real_estate_dsn#">
>
> select substring_index(p.mls_number, '_', 1) as p.mls_number,
> p.street_number, p.street_name, p.city, p.state,
> oh.mls_number, oh.date, oh.start_time, oh.end_time,
> oh.host_name
>
> from properties p
>
> left join fortstewart.open_houses oh
> on substring_index(p.mls_number, '_', 1) = oh.mls_number
>
> where p.listing_office_mls_id =
> '#arguments.listing_office_mls_id#'
> order by p.street_name, p.street_number
>
> </cfquery>
>
> I keep getting a CF error stating I have a syntax error on this line:
>
> where p.listing_office_mls_id =
> '#arguments.listing_office_mls_id#'
>
>
> Anything?
>
> Thanks!
>
> Rick
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354820
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm