Hello

I have a function that was written by PHV from the TekTips forum many years ago that I haven't been able to apply. The function is for the calculation of percentile values for ED length of stay per day and I want to use per hour of day.

The code:
Please Login or Register  to view this content.
In the actual SQL query of Access I would use:
Please Login or Register  to view this content.
The above works correctly because it's by day. But what if I want it to be by hour of day? Where I get stuck is the SQL portion of the function if I wanted to select on hour(AdmDateTime). Hopefully someone can help? Thanks.