title: Subquery in Linq query giving A query body must end with a select clause or a group clause
body: <p>booked - below - should be the sum of the NumberBooked column from the Bookings table - which has a link to the TourDates table on the TourDateId.</p>
  
  <p>However I'm getting the error <code>A query body must end with a select clause or a group clause</code></p>
  
  <p>Can anyone please help me fix this query?</p>
  
  <p>Thank you,</p>
  
  <p>Mark</p>
  
  <pre><code>var tours  = from t in Tours
     join d in TourDates on t.TourId equals d.TourId
     where d.Date == dt
        select new
          {
             t.TourId,
             d.TourDateId,
             booked = (from b in Bookings where d.TourDateId == b.TourDateId) 
                       Select new {bk.Sum(b.NumberBooked()} 
         };
  </code></pre>