Last post Aug 07, 2016 12:31 PM by robdob
Aug 06, 2016 06:56 PM|robdob|LINK
this is my query,
UPDATE Municipalities SET AvgResTownHousePriceChange30 = (CONVERT(float, 0 ) / CONVERT(float, (Table1.AvgResTownhouse30))) * 100 from(SELECT AvgResTownhouse AS AvgResTownhouse30 FROM StatsMunicipalities AS StatsMunicipalities_1 WHERE(DateCreated = 'July 07, 2016') AND(Municipality = 'Adjala-Tosorontio') AND(Community = 'Everett')) as Table1 , TotalResListings = 11 where RecordID = 1
I've getting the following error:
incorrect syntax near '='
I can't seem to get the derived table to work within query above, any suggestions would be greatly appreciated. thank you..
Aug 07, 2016 01:49 AM|oned_gk|LINK
Try modify like this
UPDATE Municipalities SET AvgResTownHousePriceChange30 = (SELECT (CONVERT(float, 0 ) / CONVERT(float, (Table1.AvgResTownhouse30))) * 100 FROM ...
Aug 07, 2016 12:31 PM|robdob|LINK
thanks, I've got it half working now, I'm getting a divide by zero in some cases and now am having problems using a iif( in combination with my query, I will post that a another question..