Staff without hours between two dates
###
Rota
###
33609/Any rev01
###
All staff who have not worked any hours between two dates
###
en
###
$VAR from DATE Enter from date$
$VAR to DATE Enter to date$

SELECT o.OwnerName
FROM owner o
WHERE o.IsStaff = 1 
AND NOT EXISTS(SELECT ID FROM ownerrota WHERE OwnerID=o.ID 
    AND StartDateTime >= '$@from$' AND EndDateTime <= '$@to$ 23:59:59' 
    AND RotaTypeID < 10)
ORDER BY o.OwnerName
###
$$HEADER
<table>
<tr><b>Staff member</b></tr>
HEADER$$

$$BODY
<tr>
  <td><a target="_blank" href="person_rota?id=$ID">$OWNERNAME</a></td>
</tr>
BODY$$

$$FOOTER
</table>
FOOTER$$

