Microsoft
Software
Hardware
Network
Question : Want to update a field with values from another field within the same table if it meets a condition
I have: Tablegz
Novice I am at SQL. Using Access 2007.
So I want to fill field FINGP with values from field PROP if PROP has values, everything is within the same table. Note that field PROP does have cells with no data--are empty in other words, not even a zero. If PROP does not have values then FINGP should get filled with the values from field EXG. Right now I get an error for missing an item using the first statement below. Do I even have the right expression for what I am trying to accomplish? Is an IIF statement allowied in an UPDATE?
UPDATE Tablegz
SET ([FINGP]=([EXG], iif([PROP]='')), [FINGP]=[PROP]
or is this more appropriate? SELECT Tablegz, IIF([PROP]=' ', [FINGP]=[EXG]), [FINGP]=[PROP]
However the second expression here asks me to enter a parameter value and if I enter nothing and press OK 3 times it returns 3 empty fields in the following order: Tablegz, Expr1001, Expr1002.
I don't know folks. I need more practice big time.
Your expertise is appreciated.
Answer : Want to update a field with values from another field within the same table if it meets a condition
UPDATE Tablegz
SET FINGP = IIf(Nz(PROP, "") <> "", PROP, EXG)
Random Solutions
Another interesting excel - add concatenate to vlookup
C#.NET Blowfish Encryption Implementation
SharePoint Project Server 2007
How can I use a combobox field to auto-fill other fields on a form?
Only one parameter passed to function but For Each...Next keeps going after first pass. Can't understand why.
How and where to install SSL Certificate for website?
how to batch rename files without extension to .wpd files
Add Windows 2008 Terminal Services to a Windows 2000 Active Directory Domain?
SSIS package : error handling
70-294 practice question