Hi, just wondering if anyone can help me. I need to do a calculation within a query using values supplied from an ASP page, then return the results ordered by the output of that calculation (make sense??).
The query is as follows:
SELECT (([Easting]^2)+([Northing]^2)^0.5) AS CalculationResult, *
FROM Shops
WHERE (Easting>=[EastingMin_IN] AND Easting<=[EastingMax_IN] AND Northing>=[NorthingMin_IN] AND Northing<=[NorthingMax_IN])
ORDER BY (([Easting]^2)+([Northing]^2)^0.5);
I've tried ORDER BY CalculationResult, and that doesn't seem to work either!
Also, does anyone know how I would return a count of all the relevant records?
If anyone can help with this, I'd be most grateful.
Danielle
The query is as follows:
SELECT (([Easting]^2)+([Northing]^2)^0.5) AS CalculationResult, *
FROM Shops
WHERE (Easting>=[EastingMin_IN] AND Easting<=[EastingMax_IN] AND Northing>=[NorthingMin_IN] AND Northing<=[NorthingMax_IN])
ORDER BY (([Easting]^2)+([Northing]^2)^0.5);
I've tried ORDER BY CalculationResult, and that doesn't seem to work either!
Also, does anyone know how I would return a count of all the relevant records?
If anyone can help with this, I'd be most grateful.
Danielle