title: Sql Server CTE "multi- part identifier could not be bound."
body: <p>My last question on this same cte query was answered so quickly, I thought I'd bounce this next one off you sql gurus. If I could go over my basic logic, then show my code and syntax error, any help would be greatly appreciated..</p>
  
  <p>I have three tables for a stock trading system: a symbols table: as the name suggests it's a list of ticker symbols, a daily pricing/ volume table: again, as- described, and each record has a date field and symbol field as well as the pricing info, and lastly a trading dates table: the reference for all trading dates in our query.</p>
  
  <p>I'd like to return a recordset with two fields: a symbol and a date. The pair represents all trading dates and symbols that don't have corresponding pricing/ vol data for that symbol in the pricing volume table. Make sense? On my query, I'm getting the error message: "The multi-part identifier "Symb.Symbol" could not be bound." Here's my cte query:</p>
  
  <pre><code>WITH Symb AS
  (
       SELECT Symbol
       FROM tblSymbolsMain
  ),
  
  DatesNotNeeded AS
  (
       SELECT Date
       FROM tblDailyPricingAndVol
       WHERE (tblDailyPricingAndVol.Symbol = Symb.Symbol)
  ),
  
  WideDateRange AS
  (
       SELECT TradingDate
       FROM tblTradingDays
       WHERE (TradingDate &gt;= dbo.NextAvailableDataDownloadDateTime()) AND (TradingDate &lt;= dbo.LatestAvailableDataDownloadDateTime())
  ),
  
  DatesNeeded AS
  (
       SELECT TradingDate
       FROM WideDateRange wdr
       WHERE NOT EXISTS (SELECT * FROM DatesNotNeeded)
  )
  
  SELECT Symb.Symbol, DatesNeeded.TradingDate
  FROM Symb CROSS JOIN DatesNeeded
  </code></pre>