Hi
I have a table with Staff names, 2nd table with leave and 3rd table with rosters.
I need to display from the staff names table any staff not on leave or rostered in sql Select Statement
see code
Select s.ID, s.FirstN, s.LastN, l.Staffid, st.staffid
FROM StaffMaster as s
Left Join LeaveTable as l on l.staffid=s.id
Left Join StaffRoster st on s.id=st.StaffId
where l.staffid is Null or (l.Fromd Not between '2022-08-01' and '2022-08-03'
and l.Tod not between '2022-08-01' and '2022-08-03')
or (st.SDate Not between '2022-08-01' and '2022-08-03')
order by s.FullN