Litters between two dates
###
Litters
###
34004/Any rev04
###
Litters entering the shelter between two dates 
###
en
###
SELECT a.ShelterCode, a.AnimalName, a.ID As AID, a.Weight, a.Markings,
t.AnimalType, s.SpeciesName, ma.BreedName, lk.Sex, bc.BaseColour,
l.AcceptanceNumber, l.NumberInLitter, l.Comments, 
ma.AnimalName AS MotherAnimalName,
ma.ID AS MAID
FROM animallitter l 
LEFT JOIN animal ma ON ma.ID = l.parentAnimalID
LEFT JOIN animal a ON a.AcceptanceNumber = l.AcceptanceNumber
LEFT JOIN species s ON ma.SpeciesID = s.ID
LEFT JOIN animaltype t ON a.AnimalTypeID = t.ID
LEFT JOIN lksex lk ON a.Sex= lk.ID
LEFT JOIN basecolour bc ON a.basecolourid = bc.ID
WHERE l.Date >= '$ASK DATE Enter the from date$' AND
l.Date <= '$ASK DATE Enter the to date$' 
ORDER BY l.AcceptanceNumber
###
$$HEADER
HEADER$$

$$GROUP_AcceptanceNumber
$$HEAD
<h2><a target="_blank" href="animal?id=$MAID">$MOTHERANIMALNAME</a></h2>
<h3>$SHELTERCODE $BREEDNAME $SPECIESNAME</h3>
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>Shelter Code</th>
<th>Acceptance Number</th>
<th>Sex</th>
<th>Base Colour</th>
<th>Markings</th>
<th>Weight</th> 
<th>Comments</th>
</tr>
</thead>
<tbody>
$$FOOT
</tbody>
</table>
<p><b>Litter Total: {COUNT.NUMBERINLITTER.0}</b></p>
GROUP$$
HEADER$$

$$BODY
<tr>
<td><a target="_blank" href="animal?id=$AID">$ANIMALNAME</a></td>
<td>$SHELTERCODE</td>
<td>$ACCEPTANCENUMBER</td>
<td>$SEX</td>
<td>$BASECOLOUR</td>
<td>$MARKINGS</td>
<td>$WEIGHT</td>
<td>$COMMENTS</td>
</tr>
BODY$$
$$FOOTER
<p><b>Total Litters: {COUNT.ACCEPTANCENUMBER}, Total Offspring: {COUNT.NUMBERINLITTER.0}</b></p>
FOOTER$$
