Hello and thanks in advance for any help!
I am trying to find employees not scheduled between a certain date range using a date range component.
I have a roster table that contain a column called first_last that links to another table called scheduled_assignments
scheduled_assignements table that contains a column called first_last and week
I want to return first_last if an employee is not scheduled between a date range
Below is the code that i have written so far, but it is not returning any results
SELECT
roster.first_last
FROM
roster
LEFT OUTER JOIN schedule_assignments ON roster.first_last = schedule_assignments.first_last
WHERE
schedule_assignments.first_last is null AND
(schedule_assignments.week <= {{moment(dateRange1.value.start).format('YYYY-MM-DD')}}
AND schedule_assignments.week >= {{moment(dateRange1.value.end).format('YYYY-MM-DD')}})