View Full Version : Need Help


pjohnson_73
11-02-2007, 08:22 AM
I am a beginner with Access and was hoping I could find some help on this forum.

I am in the military and I have created a database that I am using to track my soldiers. I have created a pretty simple table and inserted all pertinant data. When I create a report is where the head ache begins!

Obviously rank is pretty important in the military and other than inserting numbers before the actual ranks, I can't seem to get a MAJ (Major) to outrank a CPL (Corpral)...obviously because it is sorting it alphabetically.

Basically my question is how would I go about creating ranks and then sorting them by the order of importance...not alphabetically?

Thanks for any assistance!

Perry

boblarson
11-02-2007, 08:35 AM
You should really have a rank table which then you can set the sort order using a special sort order field you create. You would, if using a normalized database, assign the rank to the person using that rank table's ID instead of rank text. Then, you can just link the two tables in your query for your reports and pull the rank name instead of ID when actually displaying data.

GaryPanic
11-02-2007, 08:46 AM
or in your table for rank
have
Rankname
Rankposition

so Private and 1 now have your qry/combo sort either decending or ascending depending on what rank you want at the top

so Private 1
Lance Corporal 2
Corporal 3
Sergent 4
Staff Sergent 5
W.O 1 6
W.O2 7
RSM 8
RSM* 9 (there are only 6 of these at any 1 time )
QMSM 10 all the way through to Field Marshal
to make your list techinically correct (for the UK anyway ) the head of State should be there as well under whatever rank they have

- you will run into a small problem with ranks that are the same that have different names - you might want to tie these down to your pay structure

assuming the ranks within the UK

you have corporal of the Horse = Sergent so both will have a code of 4
Bombardier = corporal
Gunner is Private

then if you mix and match the services airforce/navy etc you got to take this into account ....

GaryPanic
11-02-2007, 08:47 AM
just read Bob's post - he has put this a lot better than I ....
but i hope my take on this makes sense

regards

pjohnson_73
11-03-2007, 08:14 PM
Thanks for the awesome help! Database is working great now! Appreciate all of the info!

boblarson
11-03-2007, 10:46 PM
Glad we could help. :)