2020 Dec 16 10:22 PM
My requirement is to fetch the current year by using the system date variable in the CDS view.
I am using the substring function along with $session.system_date field in the where clause but it is not allowing me to use it.
Can someone guide me on how to use it in the where clause?
My requirement is to fetch the current year by using the system date variable in the CDS view.
I am using the substring function along with $session.system_date field in the where clause but it is not allowing me to use it.
Can someone guide me on how to use it in the where clause?
2020 Dec 17 3:38 AM
Hi husainsd
please check below code you can able to understand,
define view ZK_I_DATE_FUNC as select from ZK_I_DATE_FUNCTIONS
{
Id,
Name,
StartDate,
EndDate,
//date functions
DATs_is_valid(StartDate) as s_Date1,
dats_is_valid(EndDate) as e_Date1,
dats_days_between(StartDate, EndDate) as betweenS,
dats_add_days(StartDate, 7, 'NULL') as ad_days,
dats_add_months(StartDate, 2, 'FAIL') as ADD_MONTHS,
DATS_ADD_DAYS(StartDate, 4, 'INITIAL') as option4,
DATS_ADD_DAYS(StartDate, 2, 'UNCHANGED') as option5
} where StartDate = $session.system_date
2020 Dec 17 5:44 PM
Hi Kiran,
I need to extract the current year from the system.date. In the where clause something like
year= system.date+4?
Can we do this?
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |