Hi! Here's an example of the data I am working with. The data is coming into ASP as a recordset from a SQL Server 2005 database view I wrote. I want to get the avg, min and max values from the recordset. The function avg works but not min and max so that tells me these functions do not exist in VBscript. I cannot do the min / max functions in the view because I need to get date range input from the users on the web form to know the range of records to include. Therefore, I need to calculate these values from the web page.
ID Location LocDate LocMinutes
2 ABC 10/2/2007 7
4 ABC 12/3/2007 15
6 ABC 10/4/2007 10
Here's the query string I have set up on the web page. If I remove the min and max parts below, the result works fine and I get the correct avg. But I need the min and max values too. Using the example data, I would want the recordset to return 7 as the min and 15 as the max.
select Location, avg(LocMinutes) as AvgMin, min(LocMinutes) as MinMinutes, max(LocMinutes) as MaxMinutes from vwMinutes