on 2024 Oct 29 6:44 PM
In Crystal Reports, how to subtract a number of business days (Monday through Friday) from an input date?
For example, October 29, 2024 - 16 business days = October 7, 2024
Request clarification before answering.
Hi,
Use this function module to subtract a number of business days (Monday through Friday) from an input date.
DATA: lv_date TYPE sy-datum. "Input Date
DATA: lv_business_days TYPE i VALUE 10. "Number of business days to subtract
DATA: lv_new_date TYPE sy-datum. "Output Date
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = lv_date "October 29, 2024
days = lv_business_days "16 business days
months = 0
years = 0
signum = '-'
IMPORTING
calc_date = lv_new_date. "October 7, 2024
WRITE: / lv_date, lv_new_date.
Regards,
Ranjan Panda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In ALL software if you hit the F1 key you will get the Help file attached.
Then search for "DateAdd (intervalType, nIntervals, startDateTime)"
Or something similar should work for you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.