×
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.
Hi,
If you are already on release V5R4, the easiest way is to use the SQL scalar
function LAST_DAY in embedded SQL:
Exec SQL Set :EndNxtMon = Last_Day(:MyDate + 1 Month);
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [
mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von derek gonsalves
Gesendet: Tuesday, June 19, 2007 15:43
An: RPG400-L@xxxxxxxxxxxx
Betreff: Last day of the next month
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
As an Amazon Associate we earn from qualifying purchases.