Search Parameter with date time

I have condition parameter search for ItemType Part like this (modified_on > 2019-04-11T00:00:00 and  modified_on <= 2019-04-20T00:00:00)

Case 1. When I new item AML  to search

<Item type="Part" action="get" select="*" where="[Part].modified_on &gt; '2019-04-11T00:00:00'  AND [Part].modified_on &lt;='2019-04-20T00:00:00' >".

----> it will return list Part with Part modified on 2019:04:05T00:00:00 -> Wrong, I dont know why the result is wrong

Case 2. So I change code to create new AML 

<Item type="Part" action="get" select="*">

 <modified_on condition="gt">2019-04-11T00:00:00 </modified_on>

 <modified_on condition="le">2019-04-20T00:00:00</modified_on>

</Item>

----> It will return true results. So please help to find error in this case 1. Thanks so much

Parents
  • Hi Anhht

    I guess the error is because of the = in your first query (after &lt;)

    <AML>
    <Item type = "Part" action = "get" where="[Part].modified_on &gt; '2019-04-11T00:00:00' AND [Part].modified_on &lt;'2019-04-20T00:00:00'"></Item>
    </AML>

    Alternately, you can use below query also to get the expected results

    <AML>
    <Item type="Part" action="get">
    <modified_on condition="between">2019-04-11T00:00:00 and 2019-04-20T00:00:00</modified_on>
    </Item>
    </AML>

    Another Way

    <AML>
    <Item type="Part" action="get">
    <modified_on condition="gt">2019-04-11T00:00:00</modified_on>
    <modified_on condition="lt">2019-04-20T00:00:00</modified_on>
    </Item>
    </AML>

    Thanks,

    GK

Reply
  • Hi Anhht

    I guess the error is because of the = in your first query (after &lt;)

    <AML>
    <Item type = "Part" action = "get" where="[Part].modified_on &gt; '2019-04-11T00:00:00' AND [Part].modified_on &lt;'2019-04-20T00:00:00'"></Item>
    </AML>

    Alternately, you can use below query also to get the expected results

    <AML>
    <Item type="Part" action="get">
    <modified_on condition="between">2019-04-11T00:00:00 and 2019-04-20T00:00:00</modified_on>
    </Item>
    </AML>

    Another Way

    <AML>
    <Item type="Part" action="get">
    <modified_on condition="gt">2019-04-11T00:00:00</modified_on>
    <modified_on condition="lt">2019-04-20T00:00:00</modified_on>
    </Item>
    </AML>

    Thanks,

    GK

Children