Link to home
Start Free TrialLog in
Avatar of LillyC
LillyCFlag for United Kingdom of Great Britain and Northern Ireland

asked on

RE: Syntax error in qery SQL when using where and like

Hi,
I am trying to create new field in query that removes letter F fro the end of string.  The letter appears only in some records.  I have tried below but get a syntax error message:

SPNew: Left([Rstr],Len([Rstr])-1) where [Rstr] like '*F'

where am I going wrong with syntax?

Thank you
LillyC
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try this:
SPNew: IIf( [Rstr] like '*F', Left([Rstr], Len([Rstr])-1), [Rstr])

Ron
How about this:

SPNew: IIF (Right([Rstr],1)="F", Replace (Right([Rstr],1),"F",""), [Rstr])
Avatar of LillyC

ASKER

Perfect, thanks  :-)