Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
9 years ago

Unable to apply condition on "created_on" property for a Part.

Hi ,
I am trying to apply filter on created_on property of a part . 1: When I fetch a  part , it shows <created_on>2017-05-16T15:20:49</created_on> in the aml studio. 2 :But when I use following aml query to fetch a part: <AML> <Item type="Part" action="get" > <created_on>2017-05-16T15:20:49</created_on> </Item> </AML> It gives me error saying : <![CDATA[No items of type 'Part' found using the criteria: <Item type="Part" action="get"><created_on>2017-05-16T15:20:49</created_on></Item> ]]> 3: When I search in sql server table , innovator.Part table has   2017-05-16 09:50:49.753 date for the same part . Is there anything wrong/remaining  in  installation. How can I get proper part based on date filter ? Can anybody help me with this issue. Thanks in advance . Thanks & Regards , Ketan.
 

3 Replies

  • eli_donahue's avatar
    eli_donahue
    Community Manager
    Hi Ketan, The date/time values you see in AML Studio and SQL Server are different for two reasons:
    1. The database stores date properties in the UTC representation of the corporate time zone, while clients display dates in local time. For example if I create a Part on a client in EDT, the client will show 2017-05-10T13:21:25. If the corporate time zone is not set or is also in EDT, the database will show 2017-05-10 17:21:25.xxx because 13:21:25 EDT = 17:21:25 UTC.
    2. The database stores a more precise time than is displayed in the client, hence the .xxx that appears at the end of a SQL datetime.
    I don't believe it is possible to filter for an item's created date to the precision that is stored in the database (yyyy-mm-dd hh:mm:ss.xxx), but you can filter to the second an item was created:
    <AML>
     <Item type="Part" action="get">
       <created_on condition="between">2017-05-10T13:21:25 and 2017-05-10T13:21:26</created_on>
     </Item>
    </AML>
    If you know the precise date saved in the database, you can filter using a where clause in your AML:
    <AML>
    <Item type="Part" action="get" where="Part.created_on='2017-05-10 17:21:25.967'"/>
    </AML>
    
    

    Eli Donahue Aras Labs Software Engineer
  • Hi Eli, Thanks a lot for reply ! I tried it using above aml . It worked . -Ketan
  • R_'s avatar
    R_
    Creator I
    hi i am using  following aml query <AML> <Item type='Bal_BinCard' action='get'> <bal_bincarddate condition='between'>2018-06-01T17:01:58 and 2018-06-01T17:01:59</bal_bincarddate> </Item> </AML> but i get error-  Incorrect value explanation: Parse error occurred during analyze condition attribute:\r\n Incorrect syntax near T17:.