Solved

Search field and replace two others

Posted on 2013-11-27
3
235 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
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Chris Millard earned 500 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

778 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