Hi All,
I have a column name created date in db as datetime . When I am creating filter in expression rule as createddatefrom and createddateto . I am not able to filter it .
Expression Rule:
a!queryFilter( field: "createddate", operator: "between", value: { todate(ri!createddatefrom), todate(ri!createddatefrom)+ day() }, applywhen: not(rule!APN_isEmpty(ri!createddatefrom)) ), a!queryFilter( field: "createddate", operator: "between", value: { todate(ri!createddateto), todate(ri!createddateto) + day() }, applywhen: not(rule!APN_isEmpty(ri!createddateto)) ),
Please help and thanks in Advance
Discussion posts and replies are publicly visible
Do you want to find all rows where the create date is between datefrom and dateto? If yes, what are the two filters doing? I think a single filter should do the job.
a!queryFilter( field: "createddate", operator: "between", value: { todate(ri!createddatefrom), todate(ri!createddateto) }, applywhen: and( not(rule!APN_isEmpty(ri!createddatefrom)), not(rule!APN_isEmpty(ri!createddateto))) ),
Hi Stefan,
I have column in DB as datetime .. Will it work for the same or else i choose only date in Expression rule.
aftre Implementing above , I am getting this error
Expression evaluation error [evaluation ID = c8d53:7380c] in rule 'twm_alldecomsites' (called by rule 'twm_decomrequestssummary') at function a!queryEntity [line 3]: Cannot apply operator [BETWEEN] to field [createddate] when comparing to value [TypedValue[it=107,v={2021-09-01,2021-09-21}]].
For the operator "BETWEEN" the datatypes of the passed values and in DB must match.
but in expression rule I can not pass the date and time , because I am using a!datefield in interface to pass the value
OK, but you field in DB is a dateTime. Why not just use a todatetime() to turn your dates into datetimes?
It worked but while choosing createddateto if am choosing one day extra then its showing me data else its not showing ..
Example:
I have a data in grid where created date is 21/09/2021 and 22/09/2021
if am choosing createddatefrom as 01/09/2021 and createddateto as 22/09/2021 . then its showing data till 21/09/2021 ..
and
if am choosing createddatefrom as 01/09/2021 and createddateto as 21/09/2021 . then its showing no data to display