Average Length of Stay in Beastmode

Options

I am trying to get the average length of stay using our admission date till our discharge date. I tried using the datediff function and got an error when validating, "Calculation error: whoops! something went wrong." I have flipped the discharge date and the admission date and the same error comes up. I feel like I am missing something.

Best Answer

  • MichelleH
    MichelleH Coach
    Answer ✓
    Options

    @AshleySizemore Are both of your columns stored as date fields? If they aren't, then you will have to convert them to date. Otherwise I'd suggest closing out of Analyzer and trying again.

Answers

  • MichelleH
    MichelleH Coach
    Answer ✓
    Options

    @AshleySizemore Are both of your columns stored as date fields? If they aren't, then you will have to convert them to date. Otherwise I'd suggest closing out of Analyzer and trying again.

  • Yes, both of my columns are date fields. I did try to close it and tried it again, and same error. I did get it to validate with: AVG(DATEDIFF(discharge_date,admission_date))

    thank you