Shelter Manager Reporting #1400
-
Hi - I need a report that shows medical information of the animal, but also the address not just name of the current foster person, the build query doesn't allow those two to 'mix' and was wondering if there was another way? I basically need the medical "due" of the current fosters but also the address to send the medication to without having to cross reference two spreadsheets. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi, The following SQL and HTML should do what you need if you copy them into a new report.
Kind regards, Jon |
Beta Was this translation helpful? Give feedback.
-
Thank you that’s soooo great. I also forgot I need the dogs weight in it?:/Could you help add that too?SarahSent from my iPhoneOn 10 Jan 2024, at 2:58 am, Jon ***@***.***> wrote:
Hi,
The following SQL should do what you need if you insert it into a new report:
$VAR from DATE Enter from date$
$VAR to DATE Enter to date$
SELECT animal.AnimalName, owner.OwnerName, owner.OwnerAddress, owner.OwnerPostcode,
owner.OwnerTown, owner.OwnerCounty,owner.OwnerPostcode,
owner.EmailAddress,
animalmedicaltreatment.DateRequired, animalmedical.TreatmentName AS MedicalType
FROM animal
INNER JOIN adoption ON adoption.ID = animal.ActiveMovementID
INNER JOIN owner ON adoption.OwnerID = owner.ID
INNER JOIN animalmedical ON animalmedical.AnimalID = animal.ID
INNER JOIN animalmedicaltreatment ON animalmedicaltreatment.AnimalMedicalID = animalmedical.ID
WHERE animal.ActiveMovementType = 2
AND animal.DeceasedDate Is Null
AND animalmedicaltreatment.DateGiven Is Null
AND animalmedicaltreatment.DateRequired >= ***@***.***$'
AND animalmedicaltreatment.DateRequired <= ***@***.***$'
ORDER BY AnimalName;
If you generate the HTML rather than writing your own, and you want the name and all the address to appear in a single field, replace the HTML for the name and address data with the following.
$OwnerName
$OwnerAddress
$OwnerTown
$OwnerCounty
$OwnerPostcode
Kind regards,
Jon
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi, I have added weight for you below.
Kind regards, Jon |
Beta Was this translation helpful? Give feedback.
Hi,
The following SQL and HTML should do what you need if you copy them into a new report.