I am a novice database user. I am analyzing a data set that is compiled monthly and I would like to use a SQL query to return multiple percentile values that are calculated / grouped by month.
I was able to find a SQL query provided in a previous thread that will give me a single percentile value for the entire dataset but not grouped by month.
SELECT Max([Value]) AS Percentile
FROM (SELECT TOP 50 PERCENT [Value]
FROM [Table/Query]
WHERE [Value] IS NOT NULL
ORDER BY [Value] ASC) AS [TemporaryTableName];
The above works great but returns a single value
Percentile
50th%Value
The output I am striving for is :
Month | 25thPercentile | 75thPercentile
02/2017 | 25th%Value for 02/2017 | 75th%Value for 02/2017
03/2017 | 25th%Value for 03/2017 | 75th%Value for 03/2017
04/2017 | 25th%Value for 04/2017 | 75th%Value for 04/2017
Any help would be greatly appreciated!!