M
mbr96 via AccessMonster.com
I'm trying to build an expression in a query that will test two fields and
reutrn a value based on the following logic:
*******
If the 1st digit of the LeaseNum field is "S", and
If the CompanyCode is 78, return "SOCA-08", if not, return "SOCA-01"
If the 1st digit of the LeaseNum field is "N", and
If the company code is 78, return "NOCA-08", if not return "NOCA-01"
*******
So far, I have
CustNum: IIf(Left([LeaseNum],1)="S",IIf([CompanyCode]="78","SOCA-08","SOCA-
01"))
but that just works for the "S" LeaseNums. Not sure how to nest another Iif,
or use a Case statement somehow??
Help please?
MBR
reutrn a value based on the following logic:
*******
If the 1st digit of the LeaseNum field is "S", and
If the CompanyCode is 78, return "SOCA-08", if not, return "SOCA-01"
If the 1st digit of the LeaseNum field is "N", and
If the company code is 78, return "NOCA-08", if not return "NOCA-01"
*******
So far, I have
CustNum: IIf(Left([LeaseNum],1)="S",IIf([CompanyCode]="78","SOCA-08","SOCA-
01"))
but that just works for the "S" LeaseNums. Not sure how to nest another Iif,
or use a Case statement somehow??
Help please?
MBR