467,119 Members | 1,156 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,119 developers. It's quick & easy.

Extract string from a text

Hi,

Please help as this is urgent.

I have the following data in a column. In the report I want to display them only with whatever is before the "-".

A SECOND DAY, INC.-FORMAT 4
A SECOND ADY, INC-VERSION 1
A SECOND DAY,INC.-VERSION 1
CLAIR FOUNDATION - OPTION 1
CLAIR FOUNDATION - OPTION 3
CLAIR FOUNDATION - OPTION 4
C.O.T.I.C. - GRADE 3
RACE D&FS - GRADE 1

PLease help.

Thanks in advance
Jun 24 '08 #1
  • viewed: 1273
Share:
1 Reply
Megalog
Expert 256MB
Well, as a quick fix you can either:

Add this to the control on the report, under it's 'Control Source'
Expand|Select|Wrap|Line Numbers
  1. =Trim(Left([YourFieldName],InStr([YourFieldName],"-")-1))
or

Go to the report's recordsource, and in design view add in a new field expression, like:
Expand|Select|Wrap|Line Numbers
  1. NewFieldforReport: Trim(Left([YourTableFieldName],InStr([YourTableFieldName],"-")-1))
Just replace the data in the brackets with your actual names.
Jun 24 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Sharon | last post: by
8 posts views Thread by nick | last post: by
9 posts views Thread by flit | last post: by
1 post views Thread by Alberto Sartori | last post: by
1 post views Thread by rcamarda | last post: by
5 posts views Thread by Steve | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.