Date and time filter in expressio rule

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

Parents
  • 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)))
    ),
    

Reply
  • 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)))
    ),
    

Children