Author Topic: Custom Tag Search  (Read 735 times)

barryg

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Custom Tag Search
« on: March 14, 2018, 08:33:59 am »
I tried the following search in the SQL scratch pad, and it works correctly.

select c.name as Name
from (t_object c
inner join t_objectproperties op on op.Object_ID = c.Object_ID)
where op.Property = 'MyTagName' and op.Value = 'Yes'

but i want to use this same search to create a TimeSeriesChart, but when i paste the code in, and test the query, it pops up with

"The multi-part identifier "t_object.Package_ID" could not be bound"

Any ideas what I'm doing wrong?

Nizam

  • EA User
  • **
  • Posts: 301
  • Karma: +9/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Custom Tag Search
« Reply #1 on: March 14, 2018, 10:56:10 am »
Are you sure its the same query that's causing this eror?  I have similar queries in my charts (SQL Server) and they seem to work fine.

may be this thread could help.
https://stackoverflow.com/questions/7314134/the-multi-part-identifier-could-not-be-bound/7314936

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2527
  • Karma: +33/-2
    • View Profile
Re: Custom Tag Search
« Reply #2 on: March 14, 2018, 12:23:09 pm »
I suspect what's happened is that you have also selected a package or branch to limit the search, so EA tries to add 'AND t_object.Package_ID IN (...)' to the where clause but it doesn't work because you have aliased t_object. Try re-writing your query without the table aliases.
« Last Edit: March 14, 2018, 12:25:51 pm by KP »
The Sparx Team
support@sparxsystems.com