I've got a query on a custom table that I need to pass 2 parameters to. The parameters need to be in the SELECT statement and not the WHERE or ORDER BY. How would I accomplish this by creating a new webpart? Adding a query or stored procedure to the custom table, if so, how do I pass the parameters to it? Through the Columns property?
Here is the query and the parameters I need (@CenterLongitude, @CenterLatitude)
SELECT *, GEOGRAPHY::Point(Latitude, Longitude, 4326).STDistance('POINT(' + CAST(@CenterLongitude AS NVARCHAR(100)) + ' ' + CAST(@CenterLatitude AS NVARCHAR(100)) + ')')/1609.344 AS ProxDistance -- in miles
FROM Custom_Location
ORDER BY ProxDistance