Filter datetime in query entity

Hi Team,

How do we filter the query entity with datetime (2023-01-13 14:03:59) like how we filter a string.

Can anyone please tell how can we filter the entity with one specific datetime value?

Eg:

a!queryFilter(
field: "value",
operator: "=",
value: "test"
),

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    for this sort of inquiry you should really include what you're hoping to accomplish overall, what you've tried and what hasn't worked, etc...

    i'll point out though that when you query on a datetime value, you're querying the exact value stored in that field which is actually some high-precision decimal that is rendered as a date-time value by the DB as well as by appian.  to get something to match the "=" operator, you'd need to pass in the exact, *exact* same value that the DB column currently holds, which if it was captred from a live timestamp for instance, might be very tricky to do.

    the solution to that is, usually, to do a range filter (easiest way is using the "between" operator), passing in datetime values for both the upper and lower limits.  IIRC you just pass these in as an array (in that order) in the "value:" parameter of a!queryFilter().

Reply
  • 0
    Certified Lead Developer

    for this sort of inquiry you should really include what you're hoping to accomplish overall, what you've tried and what hasn't worked, etc...

    i'll point out though that when you query on a datetime value, you're querying the exact value stored in that field which is actually some high-precision decimal that is rendered as a date-time value by the DB as well as by appian.  to get something to match the "=" operator, you'd need to pass in the exact, *exact* same value that the DB column currently holds, which if it was captred from a live timestamp for instance, might be very tricky to do.

    the solution to that is, usually, to do a range filter (easiest way is using the "between" operator), passing in datetime values for both the upper and lower limits.  IIRC you just pass these in as an array (in that order) in the "value:" parameter of a!queryFilter().

Children
No Data