Hi Pete,

Thanks for the reply ...

If only it were that straightforward :)

What I need to do is change the parameters of the search on the first tables
depending on various conditions of a column in a table not otherwise
included in the query.

I have a feeling CASE will do it somehow, but I can't get the syntax.


Jenny


>>-----Original Message-----
>>From: Pete Jordan [mailto:houseoffus...@skydancer.org.uk]
>>Sent: 22 May 2011 19:00
>>To: cf-talk
>>Subject: Re: SQL Quandary
>>
>>
>>
>>What Russ wrote regarding your parameters table.
>>
>>I've not got an SQL server box booted up to check, but the equivalent of
>>the following sort of thing works fine in MySQL:
>>
>>SELECT dbo.tbl_stock.stockID, dbo.tbl_stockItems.stockItemID,
>>dbo.tbl_stockItems.projected
>>FROM dbo.tbl_stock INNER JOIN
>>dbo.tbl_stockItems ON dbo.tbl_stock.stockID =
>>dbo.tbl_stockItems.stockID
>>INNER JOIN dbo.tbl_parameters ON dbo.tbl_parameters.someKey = 'some value'
>>where stockID > 0 AND
>> (dbo.tbl_parameters.someField != '#thisValue#' OR
>>stockitems.Projected > 0)
>>
>>As long as your parameters table join condition only ever matches one
>>record, you should be fine.
>>
>>
>>--
>>Pete Jordan
>>Horus Web Engineering Ltd
>>90 Belvoir Street
>>Hull HU5 3LR
>>p: 01482 446471
>>m: 07973 725120
>>
>>
>>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:344819
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to