4 Replies Latest reply: Sep 9, 2015 12:09 PM by Karen Mujeyi RSS

    Creating a list table based on two or more tables and using Is Null

    Karen Mujeyi


      Hello,

       

      I was wondering if I could get some guidance on how to create a table by creating a new column in my data.  Currently I have:

       

      AdmitDate, (format: M/D/YYYY)

      DischargeDate (format: M/D/YYYY)

       

      I want to create a LOS (length of stay) column that is based on the Admit and Discharge Dates:

       

      LOS = DischargeDate - AdmitDate

       

      In addition, if the DischargeDate column is NULL (or empty: no discharge date), then the LOS would be:

       

      LOS= TODAY - AdmitDate.

       

      I want to do this in the load script, but do not know the syntax to use.  Any help is very appreciated.