Darren Bartrup
Well-known Member
- Joined
- Mar 13, 2006
- Messages
- 1,296
- Office Version
- 365
- Platform
- Windows
I'm using this expression in a query:
In English:
If the first 12 letters of fldTeamName is Older People, then put OP
Else
If the first 2 letters of fldTeamName is OT or the first 3 letters of fldTeamName is PSI then put OT
Else
put fldTeamName
Is there a better or shorter way of putting this?
Any help is greatly appreciated.
Code:
Specialism: IIf(Left([tblTeamManagement]![fldTeamName],12)="Older People","OP",IIf(Left([tblTeamManagement]![fldTeamName],2)="OT","IL",IIf(Left([tblTeamManagement]![fldTeamName],3)="PSI","IL",[tblTeamManagement]![fldTeamName])))
In English:
If the first 12 letters of fldTeamName is Older People, then put OP
Else
If the first 2 letters of fldTeamName is OT or the first 3 letters of fldTeamName is PSI then put OT
Else
put fldTeamName
Is there a better or shorter way of putting this?
Any help is greatly appreciated.