Re: Survey tags
Is it possible to pull out records using survey tags in XML reports?
Information Officer
Greater Lincolnshire Nature Partnership
|
The technical forum of the NBN Trust for use by the Network. It includes discussions and announcements on the NBN Atlas, Recorder 6 and Indicia |
You are not logged in. Please login or register.
Forum → How Do I... & Other Questions → Survey tags
Is it possible to pull out records using survey tags in XML reports?
I meant to add I've found the SURVEY_TAG table and I think I should be using the CONCEPT_KEY but I can't find what this relates to?
Charles
Certainly is, but its hidden a bit. The name of the Tag is held in the TERM tables. The join from Survey is via Survey_Tag and Concept.
SELECT Survey.Item_Name, Term.Item_Name
FROM SURVEY INNER JOIN Survey_Tag ON SURVEY.SURVEY_KEY = Survey_Tag.Survey_Key
INNER JOIN Concept ON Survey_Tag.Concept_Key = Concept.Concept_Key
INNER JOIN Term ON Concept.Term_Key = Term.Term_Key
To return all Surveys even if they do not have a tag.
SELECT Survey.Item_Name,Term.Item_Name
FROM SURVEY RIGHT JOIN Survey_Tag ON SURVEY.SURVEY_KEY = Survey_Tag.Survey_Key
RIGHT JOIN Concept ON Survey_Tag.Concept_Key = Concept.Concept_Key
RIGHT JOIN Term ON Concept.Term_Key = Term.Term_Key
Mike
Excellent Mike, thanks :D
Forum → How Do I... & Other Questions → Survey tags
Powered by PunBB 1.4.6, supported by Informer Technologies, Inc.