The logic is quite obvious (in pseudo-code):
SELECT ...
FROM UsersTable
EXCEPT or NOT IN
(
SELECT DISTINCT users
FROM LogInTable
WHERE LogInDate BETWEEN @StartDate AND @EndDate
)
But if you want ot get a
LogInDate
too:
SELECT U.UserId, L.LogInDate
FROM UsersTable AS U
LEFT JOIN
(
SELECT UserId, LogInDate
FROM LogInTable
WHERE LogInDate BETWEEN @StartDate AND @EndDate
) AS L ON L.UserId = U.UserId
When user did not log-in into system at specific date, you'll get
NULL
in field
L.LogInDate
.
You haven't provide sample data, so, i can't help you more...
I hope, you got it now.
Good luck!