DATA Step, Macro, Functions and more

Length Of Stay

Posts: 1

Length Of Stay


how to calculate the length of stay for a group of patients using SQL query, I do have a table which contain Patient Id, Date of admission, date of discharge.

Appreciate your help.

Valued Guide
Posts: 596

Re: Length Of Stay

This should be straightforward because SAS dates are just formatted numbers so subtracting one from the other should give you the length of stay. However if you want something more precise you'll have to give us more details - check out this post for how to frame your question so we can help you better (in particular we'd need some sample data).

Esteemed Advisor
Posts: 5,621

Re: Length Of Stay

If your dates are SAS dates then the SQL column expression should be


intck("day", admissionDate, dischargeDate) + 1 as lengthOfStay


+ 1 is assuming that a patient admitted and discharged on the same day will have a length of stay of 1 day.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation