Vaccinations administered between two dates by vet
###
Medical
###
34409/Any rev04
###
List of all vaccinations administered between two dates grouped by vet
###
en
###
$VAR from DATE Enter from date$
$VAR to DATE Enter to date$

SELECT animal.id as aid, animal.sheltercode, animal.animalname, owner.ownername, owner.membershipnumber, vaccinationtype.vaccinationtype, animalvaccination.dateofvaccination, animalvaccination.dateexpires, animalvaccination.batchnumber, animalvaccination.manufacturer, animalvaccination.rabiestag, animalvaccination.cost, animal.breedname, animal.displaylocation
FROM animalvaccination
INNER JOIN animal ON animalvaccination.animalid=animal.id
INNER JOIN vaccinationtype ON animalvaccination.vaccinationid=vaccinationtype.id
LEFT JOIN owner ON owner. id=animalvaccination.administeringvetid
WHERE dateofvaccination >= '$@from$' AND dateofvaccination <= '$@to$'
ORDER BY ownername, animalname
###
$$HEADER
HEADER$$

$$GROUP_OwnerName
$$HEAD
<h2>$OwnerName $MembershipNumber</h2>
<table border="1">
<thead>
<tr>
<th>Animal</th>
<th>Breed</th>
<th>Location</th>
<th>Type</th>
<th>Date</th>
<th>Expires</th>
<th>Batch</th>
<th>Manufacturer</th>
<th>Rabies Tag</th>
<th>Cost</th>
</tr>
</thead>
<tbody>
$$FOOT
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><b> {SUM.Cost}</b></td>
</tr>
</tbody>
</table>
<p>Total vaccinations $OwnerName: {COUNT.sheltercode}</p>
GROUP$$
HEADER$$

$$BODY
<tr>
<td><a target="_blank" href="animal?id=$AID">$SHELTERCODE - $ANIMALNAME</a></td>
<td>$BREEDNAME</td>
<td>$DISPLAYLOCATION</td>
<td>$VACCINATIONTYPE</td>
<td>$DATEOFVACCINATION</td>
<td>$DATEEXPIRES</td>
<td>$BATCHNUMBER</td>
<td>$MANUFACTURER</td>
<td>$RABIESTAG</td>
<td>$COST</td>
<tr/>

BODY$$

$$FOOTER
FOOTER$$
