Don't know if anyone can help... I'm posting this in here as I'm not writing progress. It's more of a logic question too...
I have a list of items in a database table. They all have a rank. Based on certain criteria I want to demote certain items in the list. Can anyone help me with establishing the logic to achieving this? It sounds quite simple at first, but it gets quite confusing. Some examples using items ranked 1,2,3,4,5.
a) Rank 3 is to be demoted. It moves to rank 4, and rank 4 is promoted to rank 3.
b) Rank 5 is to be demoted. There's nowhere to go so it stays.
c) Rank 3 and 4 are to be demoted. Rank 5 becomes rank 3 and ranks 3 and 4 drop a rank.
d) Rank 4 and 5 are to be demoted. Nothing happens as there is nowhere to go.
Any thoughts? I'm getting rather bogged down!!
I have a list of items in a database table. They all have a rank. Based on certain criteria I want to demote certain items in the list. Can anyone help me with establishing the logic to achieving this? It sounds quite simple at first, but it gets quite confusing. Some examples using items ranked 1,2,3,4,5.
a) Rank 3 is to be demoted. It moves to rank 4, and rank 4 is promoted to rank 3.
b) Rank 5 is to be demoted. There's nowhere to go so it stays.
c) Rank 3 and 4 are to be demoted. Rank 5 becomes rank 3 and ranks 3 and 4 drop a rank.
d) Rank 4 and 5 are to be demoted. Nothing happens as there is nowhere to go.
Any thoughts? I'm getting rather bogged down!!