hello All
I figure it would be best to post here,
I have an Area with a property to capture the project number.
I have a table into which I have an attribute to capture the discipline detail
Lastly I have a third table for my Documents Attributes having the Discipline.
For that table, I have Define Document Code.
What would be the SQL query to have all the disciplines being listed under the discipline field locate under the Document Attributes table?
I believe the SQL query should SELECT PW_CODE, PW_DESCRIPTION FROM (TABLE NAME) WHERE PW_PROJECT=......
..... This is where i'm not sure how to create that WHERE syntax so the project list under the discipline table should equal the project number under the Area property.
Ultimately I would like to add a second filter or third filter to the WHERE. Something like WHERE A = X and/or = Y and/or = Z
In my example that could translate something like....... WHERE PW_PROJECT = project number under the area property AND/OR = PW_FILTER AND/OR = PW_ZONE
It will be something like '$PROJECT#PROJECT_Project_Number$'. You can check the value looking at system variables in PW Administrator and the single quotes are there to encapsulate the string for SQL. Note that when a project property is renamed only the label changes not the actual property name so it's best to check the exact name by adding it from the variables.
Thank you Robert
So I just need to add this at the end of my query? and i should be good?
SELECT PW_CODE, PW_DESCRIPTION FROM (TABLE NAME) WHERE PW_PROJECT=......
I wasn't sure if my select query was correct..
General syntax looks right, no (brackets) around the TABLE NAME and I assume PW_PROJECT, PW_CODE and PW_DESCRIPTION are the same spelling as the attribute names in the environment. You can add addition AND OR conditions to the WHERE clause and an ORDER BY at the end to sort. I often ORDER BY 1 to sort by the 1st column, in this case PW_CODE.
Answer Verified By: Luc Poulin