SQLTeam.com | Weblogs | Forums

Join between two tables with date between conditon


#1

Hi

I have two tables customer(name, address etc.) and Job(description, jobdate etc.)

I want all customer for and all jobs between given dates .if jobs not found for customer even it must show customer


#2

Something like this:

SELECT c., j.
FROM customer c
LEFT OUTER JOIN job j ON j.jobdate >= @start_date AND j.jobdate < DATEADD(DAY, 1, @end_date) AND j.customer_id = c.customer_id