title: Invalid column names ERROR
body: <p>i have a simple query below. but I don't know why I am getting an invalid column names error for field names and error value in where clause.</p>
  
  <pre><code>  select * From (
    select [SubscriberDataId]
    ,Case When ISNUMERIC([SubscriberCode]) = 0 Then cast([SubscriberCode]as varchar(9)) Else '~' end as [SubscriberCode]
    ,Case When ISDATE([Dob]) = 0 Then Cast([Dob] as Varchar(9)) Else '~' end as [Dob]
    ,Case When ISNUMERIC([FacetsGroup]) = 0 Then cast([FacetsGroup]as varchar(9)) Else '~' end as [FacetsGroup]
    from Facets.SubscriberData) [sd]
    Unpivot
    (ErrorValue for FieldName in ([SubscriberCode],
     [Dob],[FacetsGroup])) as x
    where x.ErrorValue &lt;&gt; '~' and
            NOT EXISTS (SELECT *
      FROM Elig.dbo.ErrorTable 
                  WHERE TableName = facets.SubscriberData
      AND FieldName IN( [x].[SubscriberCode],[x].[Dob],[x].[FacetsGroup])
                  AND ErrorValue IN( [SubscriberCode],[Dob],[FacetsGroup]))
  </code></pre>