Solved

Search field and replace two others

Posted on 2013-11-27
3
228 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
Comment Utility
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
Comment Utility
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
Comment Utility
:-) Indoors - trying to use up holiday allocation rather than losing it!
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now