0

I'm trying to calculate the 90th percentile of travel time for districts. I'm using MS Access.

SELECT DISTINCT District As District_Num, 
PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY Travel_Time) OVER (PARTITION BY District) AS 90th_Percentile
FROM [Incidents-J];

I'm getting the error message:

"Syntax error (missing operator) in query expression 'PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY Travel_Time) OVER (PARTITION BY District)'

Note, travel_time is in the format of h:mm:ss. Is this the issue? Is so, what would be a way of converting it into something useful (ex 0:01:20 into 80)?

  • 1
    This is SQL Server sql staement. Won't work on Access except on a connection to SQL Server. – ComputerVersteher Feb 06 '20 at 19:06
  • Access does not have intrinsic percentile function. Review http://www.fabalou.com/Access/Modules/percentile.asp and https://stackoverflow.com/questions/30872060/quartile-percentile-in-ms-access-via-sql-with-a-group-by-when-some-values-can-be – June7 Feb 06 '20 at 19:51

0 Answers0