Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 11212

Re: Month to date count of a date field

$
0
0

Hi Carmella,

 

I would have you make sure the two dates are in the same month or not.  If they are not in the same month then you can take the day from the DischargeDate.

 

You could do a formula like:

 

StringVar Admit_dt := ToText (Year ({table.AdmitDate}), 0, "", "") & "/" & ToText (Month ({table.AdmitDate}), 0, "", "");

 

StringVar Disch_dt := ToText (Year ({table.DischargeDate}), 0, "", "") & "/" & ToText (Month ({table.DischargeDate}), 0, "", "");

 

If Admit_dt <> Disch_dt Then

    Day ({table.DischargeDate})

Else {table.DischargeDate} - {table.AdmitDate};

 

When you compare the month, I included the year in case someone has been admitted for over a year.

 

Good luck,

Brian


Viewing all articles
Browse latest Browse all 11212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>