Thread: MS Access Help
View Single Post
  #2  
Old 24th May 2006, 10:20 AM
Chrome Prince Chrome Prince is offline
Member
 
Join Date: Jan 1970
Posts: 4,432
Default

Oh Chinbok,

I bet you found nothing on the net that even comes close to what you require.

I admire you converting to MSACCESS, but ranking and allowing for date track and race is not easy.
Even the Access "Gurus" were unable to help without dribbling on about VBA and still couldn't get it right after a page and a half of code!

I have since played around with examples and think I'm close to solving it, but it takes a while to get it right.

There are two options:

Option A (easy but time consuming)

Do your rankings in Excel prior to importing.

Sort by whatever it is you are trying to rank, then sort by date,track and race.

Then use this code (assuming date=columnA track=columnB race=column C)

=IF(A1&B1&C1<>A2&B2&C2,1,F1+1)

Assumes column F is the rank field and that row 1 has your column names.

Option B (very hard to explain, but if you get it right, you'll save time in the longrun)

Here's the very best page I found in 3 years on ranking:

http://www.databasejournal.com/feat...10895_3112091_6

It uses the Northwind sample database, but is a hell of a lot better than the Microsoft example.

What you need to do is allow for the other three rank by fields in the code.

Create a query within a query and make the second Query an alias.

For no values or 0 values, you'll have to do an update query.

CAUTION- do NOT use an update query straight away to do your rankings as "orphaned" entries will still get a ranking, you need the records found from relationships to only get a ranking.

Instead do a make table query and then update that table, so you have a new table based on the relationships and can run the update on that.

I need a good lie down now

Best of luck - told you it's hard.
__________________
RaceCensus - powerful system testing software.
Now with over 422,000 Metropolitan, Provincial and Country races!
http://www.propun.com.au/horse_raci...ng_systems.html
*RaceCensus now updated to 31/07/2025
Video overview of RaceCensus here:
http://www.youtube.com/watch?v=W821YP_b0Pg
Reply With Quote