Hi all - i need some help creating a query and think i've got my knickers in a twist.
Basically the attached form has a list box of all animals on a farm, including the Date Of Birth, Date Purchased and Date Moved Off. I only want the list box to be populated if the "Admin Date" falls between the 'Date Purchased' and 'Date Moved Off' OR 'Date Of Birth' and 'Date Moved Off' IF no purchase date applies.
When the admin date changes, obviously i want the listbox requerying.
This is my SQL of the query behind the listbox:-
SELECT AnimalRegister.AR_ID, AnimalRegister.TAG, AnimalRegister.Brand, AnimalRegister.Sex, AnimalRegister.Breed, AnimalRegister.DOB, AnimalRegister.[On Farm], Left([TAG],8) AS Expr1, Right([TAG],5) AS Expr2, AnimalRegister.[Purchase Date] AS Purchased, AnimalRegister.[Movement Date] AS [Moved Off]
FROM AnimalRegister
WHERE (((AnimalRegister.TAG)<>"Not tagged"))
ORDER BY AnimalRegister.Sex, Left([TAG],8), Right([TAG],5);
Any help or pointers would be greatful as i have splinters from scratching my head on this one !
I can cut the DB down & upload it if this helps.
Cheers
Basically the attached form has a list box of all animals on a farm, including the Date Of Birth, Date Purchased and Date Moved Off. I only want the list box to be populated if the "Admin Date" falls between the 'Date Purchased' and 'Date Moved Off' OR 'Date Of Birth' and 'Date Moved Off' IF no purchase date applies.
When the admin date changes, obviously i want the listbox requerying.
This is my SQL of the query behind the listbox:-
SELECT AnimalRegister.AR_ID, AnimalRegister.TAG, AnimalRegister.Brand, AnimalRegister.Sex, AnimalRegister.Breed, AnimalRegister.DOB, AnimalRegister.[On Farm], Left([TAG],8) AS Expr1, Right([TAG],5) AS Expr2, AnimalRegister.[Purchase Date] AS Purchased, AnimalRegister.[Movement Date] AS [Moved Off]
FROM AnimalRegister
WHERE (((AnimalRegister.TAG)<>"Not tagged"))
ORDER BY AnimalRegister.Sex, Left([TAG],8), Right([TAG],5);
Any help or pointers would be greatful as i have splinters from scratching my head on this one !
I can cut the DB down & upload it if this helps.
Cheers