Guided Notes

Dates & Time in Healthcare SQL

Length of stay, age at encounter, filtering date ranges, grouping by month, and the pitfalls of datetimes, time zones and inclusive ranges.

Dates everywhere

Slide 1 / 5

Healthcare analysis is full of dates: admit/discharge, service dates, birth dates, result times, enrollment spans. Common calculations: • Length of stay = discharge − admission (days). • Age at encounter = years between birth date and encounter date. • Time to event (e.g. readmission within 30 days, door-to-provider minutes). • Grouping by month or quarter for trends.