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!

extract first few characters..

Status
Not open for further replies.

abhi900

IS-IT--Management
Jul 1, 2010
117
AU
hi all,

I have a string field in use, however i want to extract jst the first few characters of tht string till it hits ";".
So basically give me everything before the ";". so it might return me 7 characters or it might be 4 characters but all do have ";" in the end.
Can someone please pass me a syntax to do this ??

you help is much appreciated.

Regards
abhi.
 
Hi,
Check the help file for the use of the Left and InStr functions.

Sample
If string ( say it is {field1}) is wert;sertooke
using

Left({field1},Instr(";")-1) would be wert

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
all do have ";" in the end
That can be handled by
Code:
split({your.field},";")[1]
If there were a few cases where the ";" was missing, Ubound can check for that.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top