Compare 2 fields from 1 query

D

DN

I have a query that tests a situation between and owner membership date and
show dates. I also need to check the rider membership date against the show
date. If the owner was not a member prior to the show date, they were not
included in the total. Here is a copy of the current query:

SELECT Shows.ShowID, Entries.Place,
IIf([Entries]>1,([Entries]-[Place])*0.5,0) AS Points1, IIf([Entries]>3 And
[Place]=1,1,0) AS Bonus,
IIf([Points1]+[Bonus]>CInt(Nz(Choose([Place],7,5,4,3,2,1),0)),CInt(Nz(Choose([Place],7,5,4,3,2,1),0)),[Points1]+[Bonus])
AS Points, Classes.Entries, Entries.ClassID, Classes.ClassNum,
Horses.HorseName, OwnersandRiders.FullName, Horses.NWHATRNumber,
Horses.Title, Horses.Titles, Shows.StartDate, OwnersandRiders.NWHAMemDate,
Shows.Year, Classes.NWHAHP, OwnersandRiders.NWHAMember,
OwnersandRiders.AddField, Entries.Rider, OwnersandRiders_1.NWHAMember
FROM Shows INNER JOIN (OwnersandRiders INNER JOIN (Horses INNER JOIN
(Classes INNER JOIN (Entries INNER JOIN OwnersandRiders AS OwnersandRiders_1
ON Entries.Rider = OwnersandRiders_1.FullName) ON Classes.ClassID =
Entries.ClassID) ON Horses.HorseName = Entries.HorseName) ON
OwnersandRiders.OwnerRiderID = Entries.OwnerRiderID) ON (Shows.Name =
Classes.ShowName) AND (Shows.ShowID = Classes.ShowID)
WHERE (((Shows.ShowID)<>269) AND
((Shows.StartDate)>=[Ownersandriders].[NwhaMemDate]) AND
((Shows.Year)="2007") AND ((Classes.NWHAHP)<>"NA") AND
((OwnersandRiders.NWHAMember)="yes") AND
((OwnersandRiders_1.NWHAMember)="Yes"))
ORDER BY Entries.Place, Classes.Entries;


I had to use a 2nd copy of the OwnersandRiders table to test for Rider
membership. How can I use this information to test the Rider like I do the
owner where it would elimiate the Rider if they were not a member by the show
date? I have tried a few combinations of things with no luck, it either
removes the Rider altogether or still includes them.

Thanks,
DN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Repost-Edit and save query criteria 5
IIF delima-Need Help PLEASE! 2
Select Query 0
IIf help 2
IIf statements 5
IIf Help! 0

Top