IIf STATEMENT - MS QUERY

lwarren1968

Registered User.
Local time
Today, 07:01
Joined
Jan 18, 2013
Messages
78
I have an express below that works well when the data meets the specified criteria. However, I need all data to be returned not just those adjusted based on the expression below. What am I missing?


Expr2: IIf(Len([Expr1])=13,Left([Expr1],12),IIf(Len([Expr1])=12,Left([Expr1],11)))
 
Hi. I'm not sure I understand, but maybe try this?


Expr2: IIf(Len([Expr1])=13,Left([Expr1],12),IIf(Len([Expr1])=12,Left([Expr1],11),[Expr1]))
 
That is exactly what I needed. Works perfectly. Thank you!
 
to simplify your IIFs:

Expr2: IIf(Len([Expr1])>11, Left([Expr1],LEN([Expr1])-1), [Expr1])
 

Users who are viewing this thread

Back
Top Bottom