Subject Re: [firebird-support] How do I remove a portion on a string?
Author Alan J Davies
select lefts(CLT_REF_NO,position('-' in CLT_REF_NO)-1)
into :youroutputref
that gives leftmost characters up to '-' MINUS the '-' itself (important)

Just note that if there is no '-' in your CLT_REF_NO you will get an
error such as "Bad parameters in substring". Its an easy fix which you
should be able to work out yourself.
HTH

Alan J Davies
Aldis

On 20/04/2011 15:50, Budi Sentosa wrote:
> Using udf
> Right
> On Apr 20, 2011 9:48 PM, "SoftTech" <miket@...
> <mailto:miket%40softtechks.com>> wrote:
> > Greetings All,
> >
> > Firebird 1.53 (Still)
> >
> > I have a CLT_REF_NO like 700317012-0000 or 1586471932548-0500
> >
> > Using a stored procedure I need to remove the dash and anything after it.
> >
> > So 700317012-0000 would be 700317012 and 1586471932548-0500 would be
> > 1586471932548
> >
> > Any help or tips appreciated,
> > Mike
> >
> >
> >
> >
> > ------------------------------------
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Visit http://www.firebirdsql.org and click the Resources item
> > on the main (top) menu. Try Knowledgebase and FAQ links !
> >
> > Also search the knowledgebases at http://www.ibphoenix.com
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > Yahoo! Groups Links
> >
> >
> >
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------------------------------------------------------
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 10.0.1321 / Virus Database: 1500/3585 - Release Date: 04/20/11
>