title: Assign a value to a variable in a select statement and then used to find value in nested select statement
body: <p>I'm getting the error </p>
  
  <blockquote>
    <p>A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations.</p>
  </blockquote>
  
  <p>Here's my SELECT statement.</p>
  
  <pre><code>SELECT A.vendor_id, **@vendor_employee** = A.vendor_employee_id
      , B.txt_first_name, B.txt_last_name,
      SELECT txt_Vendor_Employee_Detail_Element, 
          (CASE 
              WHEN txt_Vendor_Employee_Detail_Value &lt;&gt; '' 
                  AND txt_Vendor_Employee_Detail_Value IS NOT NULL 
              THEN txt_Vendor_Employee_Detail_Value 
              ELSE CONVERT(VARCHAR, txt_Vendor_Employee_Detail_Date) 
          END) AS Vendor_Detail_Element_Value 
      FROM t_vendor_employee_detail 
      WHERE vendor_employee_id = **@vendor_employee**)
  
  FROM...
  </code></pre>