Is there an easy way to determine the number of quarters between two dates which could be added as a column derivation in say, a COPY stage:
For example:
NQTRS between (2007-03-31 - 2008-03-31) + 1 = 5 (absolute value)
Those of you familar with SAS, the code would be
NQTRS = INTCK('QTR','31Mar2007'd,'31Mar2008'd) + 1;
and would return 5
Determining quarter number
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 17
- Joined: Wed Apr 16, 2008 6:39 am
- Location: Arlington, VA
Convert your dates to internal format, then use OCONV(In.Date1,'DQ') to get the quarter number and OCONV(In.Date1,'DY') to get the year and then (Date1Q+(Date1Y*4))-(Date2Q+(Date2Y*4))
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: