Book a Demo

Author Topic: Issues filtering tags that contain dates  (Read 3492 times)

motivatedgorilla

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Issues filtering tags that contain dates
« on: May 10, 2014, 12:12:37 pm »
I'm using an EAP project file and have attempted to filter tags that contain dates. For some odd reason or the other Sparx appears to store dates in 2 formats e.g. 01 May 2014 or 01/05/2014 (DD/MM/YYYY).

The query is as below returns no results even though there are tags that fall within that range

Code: [Select]
SELECT o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE,
       o.Name, type.Property, type.Value
FROM ((t_object as o
       INNER JOIN t_objectproperties as location
         ON o.Object_ID = location.Object_ID)
       INNER JOIN t_objectproperties as type
         ON o.Object_ID = type.Object_ID)
WHERE location.Property = 'Location'
  AND location.Value = 'ND'
  AND type.Property = 'FDate'
  AND CDate(type.Value) >= CDate('01/05/2014')
  AND CDate(type.Value) <= CDate('05/05/2014')

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Issues filtering tags that contain dates
« Reply #1 on: May 12, 2014, 09:06:22 am »
At a guess I would say that EA has incorrectly saved the date in the local format instead of a system independent format.

motivatedgorilla

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Issues filtering tags that contain dates
« Reply #2 on: May 12, 2014, 01:35:12 pm »
Thanks Simon. How do i resolve the issue?