IIf Help!

D

DN

This is a cross post from queries. I thought queries might not be the best
place to get help.

I have a query that uses IIf statements to calculate a point system from
current horse shows based on place and number of entries.

This is the query:

SELECT 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.[FirstName] & " " & [LastName] AS Owner,
Horses.NWHATRNumber, Horses.Title, Horses.Titles, Classes.NWHAHP,
OwnersandRiders.NWHAMember, Shows.Year
FROM Shows INNER JOIN (OwnersandRiders INNER JOIN (Horses INNER JOIN
(Classes INNER JOIN Entries 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 (((Classes.NWHAHP)<>"NA") AND ((OwnersandRiders.NWHAMember)="yes") AND
((Shows.Year)="2005"))
ORDER BY Entries.Place, Classes.Entries;

These calculations are based on horse shows with single points earned. The
last horse show of the season is double points.

Any ideas on how to adapt the above query to calculate as it does now
(single points for all shows except for the last one), but
for this one show, double the points and input the total in the Points field?

I run this query, the run a crosstab query to sum the records, then run a
make table query. The table is used to retrieve records from a web page.
Any suggestions and solutions are appreciated.
Thanks,
Debbie
 

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
Compare 2 fields from 1 query 0
IIf help 2
Select Query 0
IIF delima-Need Help PLEASE! 2
IIf statements 5
IIf ..then...case...switch - I'm not sure 8
rank query results 11

Top