I have the following in a stored procedure:
INSERT INTO
@TempOutTable
(
NoAgts,
MinDesVal,
MaxDesVal,
AvgDesVal
)
SELECT
Count (*),
Min(DesiredVal),
Max(DesiredVal),
Avg(DesiredVal)
FROM
@TempTable
The SQL Server Books on Line says that a Median function should look like this:
Syntax
Median(«Set»[, «Numeric Expression»])
The following example returns 2000 if respective Sales of the countries are 1000, 2000, and 3000:
Median({USA, CANADA, MEXICO}, Sales)
When I try to use the word "Median", I get an error message saying that Median is not a recognized function. What may be causing this (I also tried "Med")?
How would one set this up to use my set of DesiredVal?
INSERT INTO
@TempOutTable
(
NoAgts,
MinDesVal,
MaxDesVal,
AvgDesVal
)
SELECT
Count (*),
Min(DesiredVal),
Max(DesiredVal),
Avg(DesiredVal)
FROM
@TempTable
The SQL Server Books on Line says that a Median function should look like this:
Syntax
Median(«Set»[, «Numeric Expression»])
The following example returns 2000 if respective Sales of the countries are 1000, 2000, and 3000:
Median({USA, CANADA, MEXICO}, Sales)
When I try to use the word "Median", I get an error message saying that Median is not a recognized function. What may be causing this (I also tried "Med")?
How would one set this up to use my set of DesiredVal?