Christineeve
Programmer
Hi,
I'm stumped. I've searched the forums, but I'm still struggling to determine the very best way to resolve my problem. I've inherited an unnormalized database. I'm empowered to only continue to band-aide it, not normalize it or rebuild it.
This is a table that was being updated (on click) by several mile-long IIF statements in the supporting query of a form. I'd like to replace these ineffective IIF statements. Besides the obvious flaws in long IIFs, I cannot add anymore IIF critera without it crashing out.
tbl_rates
ID Rate Rate1 Rate2
15 1.2 2.0 1.7
16 1.1 1.8 .09
17 .97 2.1 1.2
I'd like to use ADO or whatever the experts here recommend to update the values in the above table (no PK or FK no relation to other tables).
Until the end of the table, I need to move the data from each column one step to the right. That is,
Rate1 moves to Rate2.
Rate moves to Rate1.
Rate is set to 0.
If it's not in this order, you replace Rate1 before updating Rate2. At least that's how I see it.
I've thought of SQL. I've thought of VBA or combination. I just cannot get a clear picture of what I should do.
Would anyone be able to suggest to me the best way to do this? I am happy to continue researching and coding something. If someone would point me in a direction to go, with a few details to start with, I'd be grateful.
Thank you for any comments you might have. If I'm in the wrong forum, I apologize. Please let me know and I'll move my post to the correct forum.
Thanks much,
Christine
I'm stumped. I've searched the forums, but I'm still struggling to determine the very best way to resolve my problem. I've inherited an unnormalized database. I'm empowered to only continue to band-aide it, not normalize it or rebuild it.
This is a table that was being updated (on click) by several mile-long IIF statements in the supporting query of a form. I'd like to replace these ineffective IIF statements. Besides the obvious flaws in long IIFs, I cannot add anymore IIF critera without it crashing out.
tbl_rates
ID Rate Rate1 Rate2
15 1.2 2.0 1.7
16 1.1 1.8 .09
17 .97 2.1 1.2
I'd like to use ADO or whatever the experts here recommend to update the values in the above table (no PK or FK no relation to other tables).
Until the end of the table, I need to move the data from each column one step to the right. That is,
Rate1 moves to Rate2.
Rate moves to Rate1.
Rate is set to 0.
If it's not in this order, you replace Rate1 before updating Rate2. At least that's how I see it.
I've thought of SQL. I've thought of VBA or combination. I just cannot get a clear picture of what I should do.
Would anyone be able to suggest to me the best way to do this? I am happy to continue researching and coding something. If someone would point me in a direction to go, with a few details to start with, I'd be grateful.
Thank you for any comments you might have. If I'm in the wrong forum, I apologize. Please let me know and I'll move my post to the correct forum.
Thanks much,
Christine