By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,100 Online
Bytes IT Community
+ Ask a Question
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
Share this Question
Share on Google+
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" <jo*****@rogers.cawrote in message
news:5g*************@mid.individual.net...
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 #3

P: n/a
"Steve" <So***@private.emailaddresswrote in message
news:4C*****************@newsread1.news.pas.earthl ink.net...
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?
I have a routine that will do exactly this.

Jul 19 '07 #4

P: n/a
I wouldn't trust anything this guy does!!
"Keith Wilby" <he**@there.comwrote in message
news:46**********@glkas0286.greenlnk.net...
"Steve" <So***@private.emailaddresswrote in message
news:4C*****************@newsread1.news.pas.earthl ink.net...
>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?

I have a routine that will do exactly this.

Jul 19 '07 #5

P: n/a
"Steve" <So***@private.emailaddresswrote in message
news:_P*****************@newsread1.news.pas.earthl ink.net...
>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.