I have a table called airliners_prices inside that i have several fields (column titles) Year, Model, Configuration, avg_new_price, avg_used_price,avg_wholesale_price.
In the past i have been using the code below to lets say change a string located in the avg_new_price of "CAPS" to "Military" site wide and it's work flawlessly.
----------------------------------------------------------------------------------------
DECLARE @find varchar(255),
@replace varchar(255),
@patfind varchar(255)
SELECT @find = 'CAPS',
@replace = 'Military'
SELECT @patfind = '%' + @find + '%'
UPDATE [airliners_prices]
SET [avg_new_prices] = STUFF( [avg_new_prices],
PATINDEX( @patfind, [avg_new_prices] ),
DATALENGTH( @find ),
@replace )
WHERE [avg_new_prices] LIKE @patfind
-------------------------------------------------------------------------------------------
However i now have a new problem. What needs to happen is now i need to first determine if the column avg_new_price has a string equal to "Military" and if so then change its corresponding avg_used_price and avg_wholesale_price values to be "---" or "N/A". 
|