SELECT inventory.idcode AS ID, [inventory.genus]+" "+[inventory.species]+" "+nz([inventory.subspecies],"") AS [Bi/Trinomial Name], IIf(inventory.***="♂","Male",IIf(inventory.***="♀","Female","Unknown")) AS ***, nz(inventory.DOB,"Unknown") AS [Birth Date], nz(inventory.cageid,"Unknown") AS Location, inventory.feedin AS FeedIn, nz(inventory.lastfeeding,"Not Eaten") AS [Last Fed], inventory.image AS [Image?]
FROM (morph RIGHT JOIN ((class INNER JOIN animals ON class.Class = animals.Class) INNER JOIN (ordertab INNER JOIN (family INNER JOIN (inventory INNER JOIN genus ON inventory.species = genus.species) ON family.genus = genus.genus) ON ordertab.family = family.family) ON class.order = ordertab.order) ON morph.idcode = inventory.idcode) LEFT JOIN cage ON inventory.cageid = cage.cageid
WHERE (((IIf([sexlookup]="Male",inventory.***="♂",IIf([sexlookup]="Female",inventory.***="♀",IIf([sexlookup]="Unknown",inventory.***="?",""))))<>False) And ((IIf([birthchoice]<>"" And [birthchoice]<>"All",[birthchoice]=inventory.birth,""))<>False) And ((IIf([cagechoice]<>"Show All",[cagechoice]=inventory.cageid,""))<>False) And ((IIf([ShowOnly]="Current Inventory",inventory.status="Keep" Or inventory.status="Available",IIf([ShowOnly]="Sold",inventory.status="Sold",IIf([ShowOnly]="Deceased",inventory.status="Deceased",IIf([ShowOnly]="Perminent (Keepers)",inventory.status="Keep",IIf([ShowOnly]="Available",inventory.status="Available",IIf([ShowOnly]="No Longer in Inventory",inventory.status="Deceased" Or inventory.status="Sold","")))))))<>False) And ((IIf([classchoice]=" Complete Inventory","",IIf([commonclasschoice]=" Complete Inventory","",IIf([orderchoice]=" Show All "+[classchoice],[classchoice]=class.Class,IIf([commonorderchoice]=" Show All "+[commonclasschoice],[commonclasschoice]=animals.commonclass,IIf([familychoice]=" Show All "+[orderchoice],[orderchoice]=ordertab.order,IIf([commonfamilychoice]=" Show All "+[commonorderchoice],[commonorderchoice]=class.commonorder,IIf([genuschoice]=" Show All "+[familychoice],[familychoice]=family.family,IIf([specieschoice]=" Show All "+[genuschoice],[genuschoice]=genus.genus,IIf([subspecieschoice]=" Show All "+[specieschoice],[specieschoice]=inventory.species,IIf([subspecieschoice]<>"",[subspecieschoice]=inventory.subspecies,IIf([specieschoice]<>"",[specieschoice]=inventory.species,[commonnamechoice]=genus.commonname))))))))))))<>False) And ((IIf([special1choice]="Morph" And [special3choice]<>"",morph.morph=[special3choice],IIf([special1choice]="Status" And [special3choice]<>"",[special3choice]=inventory.status,"")))<>False))
GROUP BY inventory.idcode, [inventory.genus]+" "+[inventory.species]+" "+nz([inventory.subspecies],""), IIf(inventory.***="♂","Male",IIf(inventory.***="♀","Female","Unknown")), inventory.DOB, inventory.cageid, inventory.feedin, inventory.lastfeeding;
Bookmarks