× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



D EndOfMnths S 2 0 DiM(12) CTDATA PERRCD(1)
D CurYear S 4 0
D CurMnth S 2 0
D NextMnthEnd S 2 0

* Check For Leap Year
C Eval CurYear = %SubDT(%Date():*YEARS)
C Eval CurMnth = %SubDT(%Date():*MONTHS)
C If %Rem(CurYear:4) = 0
C Eval EndOfMnths(2) += 1
C EndIf
C Eval NextMnthEnd = EndOfMnths(CurMnth + 1)



** EndOfMnths
31
28
31
30
31
30
31
31
30
31
30
31




Michael Schutte
Admin Professional
Bob Evans Farms, Inc.
What's the secret? Find out at your Bob Evans Restaurant on May 17!


rpg400-l-bounces@xxxxxxxxxxxx wrote on 06/19/2007 09:43:13 AM:


Hi everyone,

What would be the simplest way to find the last day of the next month?
I have a requirement, wherein i need to update a particular field with
the
first day of the next
month and another field with the last day of the next month.
I have done this using the following -

@CDate Ds
@CC 1 1 0
@CY 2 3 0
@Str51 4 4 Inz('/')
@CM 5 6 0
@Str52 7 7 Inz('/')
@CD 8 9 0

dW@dat s d



*CYMD Movel @CDate W@dat
AddDur 1:*M W@dat
*CYMD Movel W@dat @CDate

Eval cent = @CC
Eval year = @CY
Eval mont = @CM
Eval day = 01

Now this handles the first day of the next month,
How will i handle the last day of the next month. Any suggestions?

Thanks in advance
Derek

_________________________________________________________________
Who's that on the Red Carpet? Play & win glamorous prizes.

http://club.live.com/red_carpet_reveal.aspx?icid=REDCARPET_hotmailtextlink3

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.