Question Need to get Date Range for Next 24 months

Raj2010

New Member
Hi All,

I am using Progress Open Edge 10.2b.

DEFINE VARIABLE iv_DATE AS DATE NO-UNDO.
DEFINE VARIABLE iv_1_2_3_months AS DATE NO-UNDO.
..
..
DEFINE VARIABLE iv_22_23_24_months AS DATE NO-UNDO.

If i run a program say iv_DATE = TODAY (i,.e todays date is 08/29/2013).

then i need to get Next
assign
iv_1_2_3_months = 11/29/2013(today + 90 days from Date of Running this program )
iv_4_5_6_months = 02/29/2014(today + 180 days from Date of Running this program )
..
..
..
iv_22_23_24_months = 08/29/2015(today + 24 months or 2 years or 730 days).

Can any one give a simple query to get date as shown above here i don't want to Hard code
like iv_1_2_3_months = today + 90 .

Please help me.

Thanks in Advance,
Raj
 
Last edited:

TomBascom

Curmudgeon
I don't get it.

If you want a date that is X days in the future why is it that you do not want to code:

newDate = oldDate + X.

What else do you imagine can be done? Some sort of mind reading routine?
 

Cringer

ProgressTalk.com Moderator
Staff member
If you are on a sufficiently up to date version of Progress, look at the ADD-INTERVAL function in the help.
 

Nikhil Limaye

New Member
Here is a quick code that will help you generate the dates that you are wanting -
Assumption - 24 months = 24 * 30 = 720 days. Interval is 90 days. Thus, 720 / 90 = 8. Hence, the variable below is defined as Array of 8 Elements.
DEFINE VARIABLE m_date AS DATE EXTENT 8 NO-UNDO.
DEFINE VARIABLE m_cnt AS INTEGER NO-UNDO.
ASSIGN m_cnt = 0
m_date = ?.
DO m_cnt = 1 to 8 :
ASSIGN m_date[m_cnt] = TODAY + (90 * m_cnt).
END.

Hope this helps you achieve what you are looking for.
 
Top