Released to wild between two dates
###
Movements
###
3200/Any rev02
###
All animals released to the wild between two dates
###
en
###
$VAR from DATE Enter from date$
$VAR to DATE Enter to date$

SELECT adoption.MovementDate,
ShelterCode,
IdentichipNumber,
AnimalName, animal.ID AS AID,
(SELECT AnimalType FROM animaltype WHERE ID = animal.AnimalTypeID) AS AnimalTypeName,
(SELECT SpeciesName FROM species WHERE ID = animal.SpeciesID) AS SpeciesName,
AnimalAge,
(SELECT Sex FROM lksex WHERE ID = animal.Sex) AS SexName,
(SELECT LocationName FROM internallocation WHERE ID = animal.ShelterLocation) AS Location
FROM animal
INNER JOIN adoption ON adoption.AnimalID = animal.ID
WHERE adoption.MovementType = 7 AND
adoption.MovementDate >= '$@from$' AND adoption.MovementDate <= '$@to$' AND NonShelterAnimal = 0
ORDER BY MovementDate
###
$$HEADER
<table border=1>
<thead>
<tr>
<th><b>Date</b></th>
<th><b>Code</b></th>
<th><b>Microchip</b></th>
<th><b>Name</b></th>
<th><b>Type</b></th>
<th><b>Species</b></th>
<th><b>Age</b></th>
<th><b>Sex</b></th>
<th><b>Left Location</b></th>
</tr>
</thead>
<tbody>
HEADER$$

$$BODY
<tr>
<td>$MOVEMENTDATE</td>
<td>$SHELTERCODE</td>
<td>$IDENTICHIPNUMBER</td>
<td><a target="_blank" href="animal?id=$AID">$ANIMALNAME</a></td>
<td>$ANIMALTYPENAME</td>
<td>$SPECIESNAME</td>
<td>$ANIMALAGE</td>
<td>$SEXNAME</td>
<td>$LOCATION</td>
</tr>
BODY$$

$$FOOTER
</tbody>
</table>
<h2>Total: {COUNT.MovementDate}</h2>
FOOTER$$

