Page 1 of 1

Sequence job End of Quarter Date

Posted: Tue Oct 09, 2018 8:46 am
by jackson.eyton
Does anyone know how I would go about getting the end of quarter date for the current quarter? We have some processes that need to run a loop, once for just end of month, twice for end of month if that is also the end of quarter, and three times if that end of month is also the end of the year. I made a post earlier about the end of month, I got that one down, end of year is also pretty straight forward. I am not too sure on the end of quarter date. I saw that I can get the quarter number using Oconv/Iconv but I can't wrap my head around how to use that for what I am needing. Any suggestions would be greatly appreciated.

Posted: Tue Oct 09, 2018 11:29 am
by jackson.eyton
ok, never mind again.... I really didn't think this one through, got it after lunch...

Q1: Oconv(Iconv(@YEAR:"03":"31","D-YMD[4,2,2]"), "D-YMD[4,2,2]")
Q2: Oconv(Iconv(@YEAR:"06":"30","D-YMD[4,2,2]"), "D-YMD[4,2,2]")
Q3: Oconv(Iconv(@YEAR:"09":"30","D-YMD[4,2,2]"), "D-YMD[4,2,2]")
Q4: Oconv(Iconv(@YEAR:"12":"31","D-YMD[4,2,2]"), "D-YMD[4,2,2]")

Posted: Tue Oct 09, 2018 5:20 pm
by ray.wurlod
Check out the supplied Transform called QUARTER.LAST

Posted: Thu Oct 11, 2018 9:12 am
by jackson.eyton
Oconv(QUARTER.LAST(Oconv(@DATE, "DY[4]") : "Q" : Oconv(@DATE, "DQ")),"D-YMD[4,2,2]")


Interesting.......