435,264 Members | 1,100 Online
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

# Update To Value In A Field

 P: n/a I have a table that looks like: A B C D New 2 5 3 B 1 7 11 A 6 9 13 C For each record I want to update the New field to the value in the field shown in the D field (not the value in the D field!). The result should look like: A B C D New 2 5 3 B 5 1 7 11 A 1 6 9 13 C 13 How to do it? Thanks! Steve Jul 18 '07 #1
5 Replies

 P: n/a update steve set New = switch(D='A',A,D='B',B,D='C',C) Steve wrote: I have a table that looks like: A B C D New 2 5 3 B 1 7 11 A 6 9 13 C For each record I want to update the New field to the value in the field shown in the D field (not the value in the D field!). The result should look like: A B C D New 2 5 3 B 5 1 7 11 A 1 6 9 13 C 13 How to do it? Thanks! Steve Jul 19 '07 #2

 P: n/a John, Thanks for responding! I see what you are doing however there are over ten fields and that makes it complex. Do you know if this can be done with a subquery? Steve "John Winterbottom" I have a table that looks like:A B C D New2 5 3 B1 7 11 A6 9 13 CFor each record I want to update the New field to the value in the fieldshown in the D field (not the value in the D field!). The result shouldlook like:A B C D New2 5 3 B 51 7 11 A 16 9 13 C 13How to do it?Thanks!Steve Jul 19 '07 #3

 P: n/a "Steve"

 P: n/a I wouldn't trust anything this guy does!! "Keith Wilby" John,Thanks for responding!I see what you are doing however there are over ten fields and that makesit complex. Do you know if this can be done with a subquery? I have a routine that will do exactly this. Jul 19 '07 #5

 P: n/a "Steve" I wouldn't trust anything this guy does!! Praise indeed. Jul 19 '07 #6

### This discussion thread is closed

Replies have been disabled for this discussion.