I have 3 tables: Names, ToDo, TasksDone. Their columns structure is below:
'Names' table:
Name (nvarchar)
Status (nvarchar)
'ToDo' table:
Task (nvarchar)
Date (smalldatetime)
Name (nvarchar)
'TasksDone' table:
TaskStatus (nvarchar)
Date (smalldatetime)
Name (nvarchar)
'Names' table:
Name | Status
John | Available
Ryan | Available
Sean | NotAvailable
'ToDo' table:
Task | Date | Name
Washing | 01.01.2012 | John
Cleaning | 03.01.2012 | Ryan
Washing | 04.01.2012 | Sean
'TasksDone' table:
TaskStatus| Date | Name
Done | 01.01.2012 | John
Done | 02.01.2012 | Ryan
NotDone | 02.01.2012 | Sean
I want to get all the Name from the Names table with Status='Available' which are not found in ToDo and TasksDone tables on a given day (date).
try this (YOUR_DATE is your Date and must be replace)