Access qry (1 Viewer)

lwarren1968

Registered User.
Local time
Today, 14:07
Joined
Jan 18, 2013
Messages
77
I'm attemting to write a simple qry

IIf(Len([upc #])=13,Left([upc #],12))

it works fine by it's self but I want to add and "or" to it. basically my field consist of 13 and 12 characters so if there is 12 I want to return 11 as well as if there is 13 I want to return 12.
 

John Big Booty

AWF VIP
Local time
Tomorrow, 07:07
Joined
Aug 29, 2005
Messages
8,263
Welcome to the forum.

Try;
Code:
IIf(Len([upc #])=13, Left([upc #], 12), IIf(Len([upc #])=12, Left([upc #], 11)))
 

lwarren1968

Registered User.
Local time
Today, 14:07
Joined
Jan 18, 2013
Messages
77
Perfect! Thank you :)
 

lwarren1968

Registered User.
Local time
Today, 14:07
Joined
Jan 18, 2013
Messages
77
I just found a plug in "Power Query" for excel that does what I needed. Thanks anyway for your response.
 

Users who are viewing this thread

Top Bottom