Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulate Query Text Result

Status
Not open for further replies.

Costefran

Technical User
Joined
Jan 2, 2008
Messages
197
Location
GB
Hello

Can anyone help with the following

I have a query where the results of one of the columns (Called Column A) can be

ACR - 12345678
Or
ACR - 23456
Or
12345678
Or
23456

I would like to add another column (Column B) that trims column A so that the results will be
12345678
23456
12345678
23456

As you can see the "ACR - " is removed

I have tried manipulating the text in an if function but cannot seem to get it right

Any suggestion would be appreciated

Thanks
 
Something like:
Code:
Expr1: IIf(Left([columnA],1)="A",Right([columnA],Len([columnA])-6),[columnA])
Give a post back if you need anything clearing up with the syntax.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
HarleyQuinn

This works perfectly and has save me many more hours of trying to figure this out

Many Thanks
 
You're welcome, glad I could help [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top