Date and time filter in expressio rule

Certified Associate Developer

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
  • 0
    Certified Lead Developer

    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
  • 0
    Certified Lead Developer

    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