bfunction to get mid month

ekben

Well Known Member
dear all,
any function to return mid month for example, i pass in today's date(21/10/2004) and will return 15/10/2004?
i searched through but could not get one.
another thing is N0500675 (get first and last day of month) doesn't seem to work right. no report variables to select from in the available values box. i do not understand.

rgds
ekben
 
ekben,

:confused:just starting programming ?
:crazy:just keep it simple !
:D2 system functions (date) will do the trick !

good luck
 
Ekben,

All of the parameters for N0500675 are integers. You will have to create variables based on an integer Data Dictionary Item (e.g. INT01).

Barry
 
Hi ekben,

It is a routine task for beginner developers, to write a NER BSFN in the lazy hours of the morning, which get a date as input and return the middle day of the month. :)

You can simply operate with the Date category Advanced Functions in the Expression Manager of the ER Designer.

Not too complicate to handle 30 and 31 days long monthes and leap years for February, because you can easy build the date of the first day of the month and the first day of the next month and it can solve all 30, 31 day and leap year problems. If you want, you can return with the mid month as CCYYMMDD HH:MM:SS ;-)

Regards,

Zoltán
 
thanks

Dear All,
thanks for the reply. infact i have the solution
1)get date prior month end (bfunction)
2)first day = add_days(prior month end,1)
3)mid month = add_days(first day,14)
i do find its quite long and i couldn't find bfunction to get mid month that's why i posted to ask

marcel, what is D2 system functions(date)? and also i am new to jde but not new in programming. i am not full time doing jde. i also doing vba as well.

rgds
ekben
 
Back
Top