Notifications
Clear all
Topic starter
Trying to do some calculations having to do with "business days". Anyone have a function that can give you the day of the week for a date?
Thanks so much,
Posted : July 25, 2014 2:24 am
01/01/1960 was a friday, do DURATIONDAYS() with clinical date, mod() to get the remainder when divide by 7, and use a case statement to replace the remainder with a day.
I have never written that out in MEL though
Posted : July 25, 2014 3:36 am
Topic starter
That's what the developer and I were brainstorming might be a solution. Great minds and all that, Michael
Thanks so much!
Posted : July 25, 2014 4:28 am
{!fn out_dow(){ local days local result local final days = DURATIONDAYS("01/01/1960", str(._TODAYSDATE)) result = mod(val(days), 7) cond case result == 0 final = "Friday" case result == 1 final = "Saturday" case result == 2 final = "Sunday" case result == 3 final = "Monday" case result == 4 final = "Tuesday" case result == 5 final = "Wednesday" case result == 6 final = "Thursday" else "" endcond return final } }
Posted : July 25, 2014 6:45 am