AnsweredAssumed Answered

Get a Variable Value for a Configuration via Alternate Name

Question asked by Guy Edkins on Jan 15, 2020
Latest reply on Jan 17, 2020 by Guy Edkins

Using SQL for EPDM I am trying to get a particular variable's value back (Mfg Part Number) for a given a given alternate name (a configuration). I know that the DocumentRevisionConfiguration, VariableValue, and the Variable tables I need to use. So far I have not succeeded in getting just what I need, which is for handing in an alternate number get back the MFG Part Number for that particular configuration's latest revision (Max(

DocumentRevisionConfiguration.RevisionNo)). Below is what I have so far, but it hands back all the Mfg Part Numbers for the all the configurations not just the one for the 900950-01. In this case I get 4 rows, the @ tab value and the three configs in this part. Would appreciate any help here. 


SELECT        VariableValue.ValueText AS 'MFG PART #'

FROM            Documents INNER JOIN

                         VariableValue ON Documents.DocumentID = VariableValue.DocumentID INNER JOIN

                         Variable ON VariableValue.VariableID = Variable.VariableID INNER JOIN

                         DocumentRevisionConfiguration ON Documents.DocumentID = DocumentRevisionConfiguration.DocumentID

WHERE        (DocumentRevisionConfiguration.AlternateName = N'900950-01') AND (Variable.VariableName = N'MANUFACTURER PART NUMBER')

GROUP BY VariableValue.ValueText, DocumentRevisionConfiguration.AlternateName