cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter date value

Joanna
Participant
0 Kudos

Hi, Experts,

I create a custom cds view, there is a date field, the preview result is as below:

I need to filter all records which this field value =‘0000-00-00“

in CDS View filter, how to write this formula?

I try to use "is null", then all items disappeared ,then I try to use =‘0000-00-00“, then sys error.

Please help.

RGDS

Joanna Qiu

Accepted Solutions (1)

Accepted Solutions (1)

Amith_Nair
Advisor
Advisor
0 Kudos

Hi Joanna,

This is how you should set your filter in the filter section( a format):

Datasource.fieldname!='yyyymmdd'

for example:

I_GLAccountLineItem.CreationDate!='20190122'

Please try this and let me know. Thank you! Amith Nair

Amith_Nair
Advisor
Advisor
0 Kudos

joanna1981 Hi Joanna,

Yes, this is what I tried to show in my example, you should just put the filter value without any 'colon'. In my example, I want to get rid of the Creation date value for 22 Janury 2019 and hence, I provided datasource.field name != 'yyyymmdd'

Glad it worked! thanks!

Joanna
Participant
0 Kudos

Hi, Amith,

Actually "0000-00-00" is no date, is blank .

If I use I_GLAccountLineItem.CreationDate!='20190122', it means if creation date is "20190123" , it also display,

but I need all records which date value is blank , then how to write?

Please help !

RGDS

Joanna Qiu

Joanna
Participant
0 Kudos

I think I alredy find , it shoud be ='00000000', hahaha

Thank you very much.

RGDS

Joanna Qiu

Answers (0)