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
SQL code conversion for Microsoft Access 2007
Exchange 2003 SMTP conector
Outlook.Application. Trying to specify 'To' recipient by using the 'From' field.
ScaleMode in VBA
Access 07 "encountered an error during setup" on a PC that has Office 07 standard already installed
How to specify an address on the From line in Sharepoint Designer email
Slow Windows 2003 Print Server
Screen Scramble in Excel 2003
Access 2007 Exit Button ID for ribbon UI
SSIS Connection Manager