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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display characters to the left of colon 1

Status
Not open for further replies.

mgason

Technical User
Feb 6, 2003
158
AU
Hi,
I have a database field that has a long string with colons at various irregular points.
I wish to display only the characters to the left of the first colon.
This is not conveniently at the same number of characters.
How can I do this?

Also can I group by that formula?

Thanks
Mark Gason
 
You can group on the following formula:

left({table.string},instr({table.string},":")-1)

-LB
 
Thanks
that works great. I now need to protect against some bad entries by the users.
If the string has no colon I want to display and group by the complete string.
mark
 
if instr({table.string},":") <> 0 then
left({table.string},instr({table.string},":")-1) else
{table.string}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top