Hi, I need to amend the following code, which checks value of "consumer postcode" and "stock indicator". If there is no "consumer postcode" and "stock indicator" = "D" consumer post code is set to 9"." characters:
StringInfo2: IIf(([Consumer PostCode] Is Null And [Stock Indicator]="D"),String(9,"."),Left([Consumer PostCode] & String(9," "),9))
I need to amend this to include multiple IF thens... and am struggling a bit!
The revised logic needs to be:
If postcode =null AND stockID=D; post code = "......."
ELSE
IF postcode is NOT NULL and STOCK ID= D; post code = post code plus blanks to make string 9 chars
ELSE
IF postcode = null and Stock ID not=D or blank; post code = 9 blanks
ELSE
IF postcode is NOT NULL and STOCK ID not D or blank; postcode = post code plus blanks to make string 9 chars.
Hope someone can help with this.
Many thanks!
Regards, Laura.
StringInfo2: IIf(([Consumer PostCode] Is Null And [Stock Indicator]="D"),String(9,"."),Left([Consumer PostCode] & String(9," "),9))
I need to amend this to include multiple IF thens... and am struggling a bit!
The revised logic needs to be:
If postcode =null AND stockID=D; post code = "......."
ELSE
IF postcode is NOT NULL and STOCK ID= D; post code = post code plus blanks to make string 9 chars
ELSE
IF postcode = null and Stock ID not=D or blank; post code = 9 blanks
ELSE
IF postcode is NOT NULL and STOCK ID not D or blank; postcode = post code plus blanks to make string 9 chars.
Hope someone can help with this.
Many thanks!
Regards, Laura.