Members expiring between two dates
###
Membership
###
2730/Any rev02
###
Owner info for all members expiring between two dates.
###
en
###
SELECT o.OwnerName, o.ID AS OID, o.OwnerAddress, o.OwnerTown, o.OwnerCounty, o.OwnerPostcode, 
o.HomeTelephone, o.WorkTelephone, o.EmailAddress, o.OwnerTitle, o.OwnerForenames,
o.OwnerSurname, o.MembershipExpiryDate, o.MembershipNumber
FROM owner o
WHERE o.IsMember = 1 AND o.MembershipExpiryDate Is Not NULL 
AND o.MembershipExpiryDate >= '$ASK DATE Members expiring between$' 
AND o.MembershipExpiryDate <= '$ASK DATE and $'
ORDER BY MembershipExpiryDate
###
$$HEADER
<table width="100%">
<tr>
<td><b>Number</b></td>
<td><b>Expiry Date</b></td>
<td><b>Owner</b></td>
</tr>
HEADER$$

$$BODY
<tr>
<td>$MEMBERSHIPNUMBER</td>
<td>$MEMBERSHIPEXPIRYDATE</td>
<td><b><a target="_blank" href="person?id=$OID">$OWNERNAME</a></b><br />
$OWNERADDRESS<br />
$OWNERTOWN<br />
$OWNERCOUNTY<br />
$OWNERPOSTCODE<br />
$HOMETELEPHONE<br />
$WORKTELEPHONE<br />
<i>$EMAILADDRESS</i>
</td>
</tr>
BODY$$

$$FOOTER
</table>
FOOTER$$
