1

Re: Survey tags

Is it possible to pull out records using survey tags in XML reports?

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

2

Re: Survey tags

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?

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

3

Re: Survey tags

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

Mike Weideli

4

Re: Survey tags

Excellent Mike, thanks :D

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership