?
Solved

Search field and replace two others

Posted on 2013-11-27
3
Medium Priority
?
244 Views
Last Modified: 2013-11-27
This may be simple to all but just cant get my head around :(

I would like to search for a value in FA_COST_NOM and if found replace the values in both FA_DISP_NOM and FA_REVAL_NOM, all three fields are in the same FA_ACCOUNTS table.

i.e.

FA_COST_NOM    FA_DISP_NOM    FA_REVAL_NOM
11980                   11960                  11950

If 11980 is found change the other two fields to 11960 and 11950 respectively. There may be multiple records with 11980 in them.

Please help.
Regards
S
0
Comment
Question by:SimonJohnG
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Chris Millard earned 2000 total points
ID: 39680425
I'm on holiday at the moment, so don't have access to SQL, but something like:-

UPDATE FA_ACCOUNTS
SET FA_DISP_NOM = '11960', FA_REVAL_NOM = '11950'
WHERE FA_COST_NOM = '11980'

Open in new window

0
 

Author Closing Comment

by:SimonJohnG
ID: 39680455
Thank you so much, easy when you know how! Hopefully didnt take up too much of your holiday, anywhere nice?
S
0
 
LVL 17

Expert Comment

by:Chris Millard
ID: 39680475
:-) Indoors - trying to use up holiday allocation rather than losing it!
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question