SQL Query error: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Error converting data type varchar to float.
The failed query:
"
SELECT TOP 12 url,
images, year, make, model, trim, state,
(CASE
WHEN CAST(ISNULL(salePrice, 0) as float) > 0 THEN salePrice
WHEN CAST(ISNULL(listedPrice, 0) as float) > 0 THEN listedPrice
WHEN CAST(ISNULL(askingPrice, 0) as float) > 0 THEN askingPrice
WHEN CAST(ISNULL(internetPrice, 0) as float) > 0 THEN internetPrice
WHEN CAST(ISNULL(retailPrice, 0) as float) > 0 THEN retailPrice
WHEN CAST(ISNULL(msrp, 0) as float) > 0 THEN msrp
END) as salePrice FROM inventory
WHERE LEN(multipleImages) > 10 AND imageType IN ('Dealer') ORDER BY NEWID() DESC;
"