Skip to main content
New Participant
Feb 3, 2023 1:11 PM UTC
Question

Issue while fetching date from query rule

In DB I have some records with only Date and some records with date& time

Example:

2/1/2023 1:22:31 PM

10/17/2023

11/15/2023

7/07/2022

6/17/2022  2:22:32 AM

11/17/2022

9/28/2022

9/28/2022

i need to filter it out with only date but where ever time records available those records unable to filter it out

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

can someone help me with this

    6 replies

    gayathris111098
    Inspiring
    Feb 3, 2023 1:17 PM UTC

    What is the Column type for that column?

    New Participant
    Feb 3, 2023 1:19 PM UTC

    Datatype :DATE

    gayathris111098
    Inspiring
    Feb 3, 2023 1:22 PM UTC

    You can not save date and time on data type field. Can you share us more details on DB structure and values?

    New Participant
    Feb 3, 2023 1:19 PM UTC

    I have a filter for dateTime and it works fine:

    a!queryFilter(
    applyWhen: not(isnull(ri!requestsNewerThan)),
    field: "createdOn",
    operator: ">",
    value: ri!requestsNewerThan
    )

    I would say that the rule input and filtered field both need to be date/datetime).

    konduruc733182
    Inspiring
    Feb 3, 2023 2:06 PM UTC

    can you try adding these filters to your rule and check if it helps

    {
    a!queryFilter(
      field: "date",
      operator: ">=",
      value: todatetime(ri!date)
    ),
    a!queryFilter(
      field: "date",
      operator: "<=",
      value: todatetime(ri!date)+1
    )
    }

    abhayd3663
    Brainy
    Feb 12, 2023 1:20 AM UTC

    First of all, DB won't allow to save DATETIME value in DB when the column type is DATE.