Monday, November 3, 2014

Join three tables not getting all the data from the main table

Hi,


Are [ClassStartDate] and [StartDate] in [StudentBookingDetails] same in all rows?


Have you tried:



SELECT StudentBookingDetails.ClassId, StudentBookingDetails.ClassType, StudentBookingDetails.ClassStartDate, Class_Details.LessonLevel, Class_Details.LocationId,
StudentBookingDetails.StudentId, StudentBookingDetails.StudentName
FROM StudentBookingDetails LEFT OUTER JOIN
Class_Details ON StudentBookingDetails.ClassId = Class_Details.ClassId
WHERE (StudentBookingDetails.StartDate >= CONVERT(DATETIME, '2014-01-01 00:00:00', 102))

~ J.


No comments:

Post a Comment