Filter Wrong List And Library

I have a problem with filtering in list and library.

I want to filter item which has created greater than Fri May 14 2021 23:00:00 GMT+0700 (Indochina Time). So I write the code like below.
fd.control('SPDataTable1').filter = `<Gt><FieldRef Name="Created" /><Value Type="DateTime">2021-05-14T16:00:00Z</Value></Gt>` fd.control('SPDataTable1').refresh()
In my list has some item has Created greater than Fri May 14 2021 23:00:00 GMT+0700 (Indochina Time).

But List and Library return nothing

Please help me. Thanks

Dear @minh_cuong_le,
What's the issue here? From what I see - it seems to work. Your want values after 11PM and you're getting values after 11PM: 11:18PM and 11:57PM are both after 11PM.

If you don't want to include them, just move the time forward one hour and include only time starting with 12AM:

fd.control('SPDataTable1').filter ='<Geq><FieldRef Name="Created" /><Value Type="DateTime">2021-05-14T17:00:00Z</Value></Geq>'; fd.control('SPDataTable1').refresh()

Sorry, but when I use this code. My List and Library returns nothing
fd.control('SPDataTable1').filter = 2021-05-14T16:00:00Z fd.control('SPDataTable1').refresh(). I did not receive any data. I just show you that in my SP List has valid item.

Dear @minh_cuong_le,
I see, then the filter needs to be changed a bit. Try it like this, maybe?

fd.control('SPDataTable1').filter ='<Gt><FieldRef Name="Created" /><Value IncludeTimeValue='TRUE' Type="DateTime">2021-05-14T16:00:00Z</Value></Gt>';

1 Like

Yes. It worked. Thanks

1 Like