I would really appreciate some help with the following: SQL SVR 2008
JS John Smith
LJ Louise Jobes
PL Paul Lucas
CODE STATUS FROM TO
JS JOB1 09:00 10:00
JS JOB2 13:00 15:00
PL JOB94 09:00 12:00
I am trying to produce a select query that will provide a list of all names from table one that are not doing anything. So I need to compare DATETIME() with the entries in TABLE 2 and return all the names that are not currently doing anything.
The easiest way to do this is to find all the people doing something, and then return all people that do not appear in this list. that way, you break the problem down in to two parts and you can completely ignore table 1 for the first part.
Do you fancy having a stab at that first part of SQL? When you post that, please also post the datatypes for FROM and TO. We can then tweak it to solve the problem.