Microchips implanted between two dates
###
Medical
###
3000/Any rev02
###
Shelter animals implanted with microchips between two dates
###
en
###
SELECT a.AnimalName, a.ID AS AID, a.ShelterCode, t.AnimalType, a.DisplayLocation, a.IdentichipNumber, a.IdentichipDate
FROM animal a
INNER JOIN animaltype t ON t.ID = a.AnimalTypeID
WHERE a.Identichipped = 1 
AND a.IdentichipDate >= '$ASK DATE Animals implanted between$' AND a.IdentichipDate <= '$ASK DATE and$' 
ORDER BY a.IdentichipDate, t.AnimalType, a.AnimalName
###
$$HEADER
<table border="1">
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Code</th>
<th>Type</th>
<th>Location</th>
<th>Number</th>
</tr>
</thead>
<tbody>
HEADER$$

$$BODY
<tr>
<td>$IDENTICHIPDATE</td>
<td><a target="_blank" href="animal?id=$AID">$ANIMALNAME</a></td>
<td>$SHELTERCODE</td>
<td>$ANIMALTYPE</td>
<td>$DISPLAYLOCATION</td>
<td>$IDENTICHIPNUMBER</td>
</tr>
BODY$$

$$FOOTER
</tbody>
</table>
<h2>Total microchips implanted: {COUNT.ANIMALNAME}</h2>
FOOTER$$
&&&
Microchips implanted between two dates by species
###
Medical
###
3000/Any rev02
###
Shelter animals implanted with microchips between two dates by species
###
en
###
SELECT a.AnimalName, a.ID AS AID, a.ShelterCode, t.AnimalType, s.SpeciesName, a.DisplayLocation, a.IdentichipNumber, a.IdentichipDate
FROM animal a
INNER JOIN animaltype t ON t.ID = a.AnimalTypeID
INNER JOIN species s ON s.ID = a.SpeciesID
WHERE a.Identichipped = 1 
AND a.IdentichipDate >= '$ASK DATE Animals implanted between$' AND a.IdentichipDate <= '$ASK DATE and$' 
ORDER BY s.SpeciesName, a.IdentichipDate, t.AnimalType, a.AnimalName
###
$$HEADER
HEADER$$

$$GROUP_SpeciesName
$$HEAD
<h2>$SpeciesName</h2>
<table border="1">
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Code</th>
<th>Type</th>
<th>Location</th>
<th>Number</th>
</tr>
</thead>
<tbody>
$$FOOT
</tbody>
</table>
<h2>Total $SPECIESNAME microchips implanted: {COUNT.ANIMALNAME}</h2>
GROUP$$

$$BODY
<tr>
<td>$IDENTICHIPDATE</td>
<td><a target="_blank" href="animal?id=$AID">$ANIMALNAME</a></td>
<td>$SHELTERCODE</td>
<td>$ANIMALTYPE</td>
<td>$DISPLAYLOCATION</td>
<td>$IDENTICHIPNUMBER</td>
</tr>
BODY$$

$$FOOTER
FOOTER$$
&&&
Microchips implanted between two dates by type
###
Medical
###
3000/Any rev02
###
Shelter animals implanted with microchips between two dates by type
###
en
###
SELECT a.AnimalName, a.ID AS AID, a.ShelterCode, t.AnimalType, s.SpeciesName, a.DisplayLocation, a.IdentichipNumber, a.IdentichipDate
FROM animal a
INNER JOIN animaltype t ON t.ID = a.AnimalTypeID
INNER JOIN species s ON s.ID = a.SpeciesID
WHERE a.Identichipped = 1 
AND a.IdentichipDate >= '$ASK DATE Animals implanted between$' AND a.IdentichipDate <= '$ASK DATE and$' 
ORDER BY t.AnimalType, a.IdentichipDate, s.SpeciesName, a.AnimalName
###
$$HEADER
HEADER$$

$$GROUP_AnimalType
$$HEAD
<h2>$AnimalType</h2>
<table border="1">
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Code</th>
<th>Species</th>
<th>Location</th>
<th>Number</th>
</tr>
</thead>
<tbody>
$$FOOT
</tbody>
</table>
<h2>Total $ANIMALTYPE microchips implanted: {COUNT.ANIMALNAME}</h2>
GROUP$$

$$BODY
<tr>
<td>$IDENTICHIPDATE</td>
<td><a target="_blank" href="animal?id=$AID">$ANIMALNAME</a></td>
<td>$SHELTERCODE</td>
<td>$SPECIESNAME</td>
<td>$DISPLAYLOCATION</td>
<td>$IDENTICHIPNUMBER</td>
</tr>
BODY$$

$$FOOTER
FOOTER$$

