I get this error message from my SQL Server:
Invalid column name 'price'
in Microsoft SQL Server Management Studio.
My SQL statement:
SELECT
CASE
WHEN salePriceDate BETWEEN salePriceStartDate AND salePriceEndDate
THEN salePrice
ELSE
CASE
WHEN salePriceDate2 BETWEEN salePriceStartDate2 AND salePriceEndDate2
THEN salePrice2
ELSE normalPrice
END
END AS price
FROM
prices
WHERE
price BETWEEN 1 AND 100
How can I solve this?