Hello folks...
I've come to something of an issue that I keep hittin' my head on. I have two tables, users and schedule_entries, and I want to join them with an outer join for a certain date range.
My full query right now is:
SELECT u.uid, se.se_date, se.se_class, u.fname, u.lname, u.sclass FROM users u LEFT OUTER JOIN schedule_entries se ON u.uid = se.uid WHERE (se.se_date BETWEEN DATE '2006-08-06' AND DATE '2006-08-26' OR se.se_date IS NULL) AND (u.sclass = 0 OR u.sclass = 1) ORDER BY u.sclass ASC, u.lname, se.se_date ASC
I want it to return something like (ignoring the extra columns and all that):
User A -- 2006-08-06
User A -- 2006-08-07
User B -- 2006-08-06
User C -- null
User D -- 2006-08-06
and so on...
The problem I'm having is this. When User C has scheduled entries that are not the in desired date range, I can't get him to show up with a null row in the recordset - he simply won't be there. If he has absolutely no entries in the schedule_entries table at all, he'll show up with a null row.
Any ideas?
- Justin