using sql and asp and need a little bit of help please. I'm calculating the cheapest prices from 3 columns which works fine
working sql statement
but I also need to apply a cast function on the final value I output - just a simple division by 7. this is my attempt
error
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near '='.
thanks in advance
Omar
working sql statement
Code:
CARHIRE = "Select CheapestPrice = MIN(CheapestPrice) from " & _ "(Select MIN(Fully_Inclusive_Weekly_Price_Band_1) As CheapestPrice from National_Car_Prices UNION ALL" & _ " Select MIN(Fully_Inclusive_Weekly_Price_Band_2) from National_Car_Prices UNION ALL" & _ " Select MIN(Fully_Inclusive_Weekly_Price_Band_3) from National_Car_Prices )x"
Code:
CARHIRE = "Select CheapestPrice = MIN(CheapestPrice = Cast (CheapestPrice / 7 as dec (10,0)) from " & _ "(Select MIN(Fully_Inclusive_Weekly_Price_Band_1) As CheapestPrice from National_Car_Prices UNION ALL" & _ " Select MIN(Fully_Inclusive_Weekly_Price_Band_2) from National_Car_Prices UNION ALL" & _ " Select MIN(Fully_Inclusive_Weekly_Price_Band_3) from National_Car_Prices )x"
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near '='.
thanks in advance
Omar
Comment