Hi, using your code, how about left(:str,  position('**' in :str)-1));
select left(:str, position('**' in :str)-1)) from yourtable
However, to make things easier for future users, think about changing 
the single '*' to e.g. '-' and then you can keep your existing select 
statements and not have this problem when a new ABC*DEFG********01 
becomes ABC*DEFGHIJKLMN*01

Alan J Davies
Aldis


On 07/12/2015 08:29, 'checkmail' check_m...@satron.de [firebird-support] 
wrote:
> Hello @ll,
>
> I have an input string ABCDEFG, filled with * to 16 chars,
> ABCDEFG*********, followed with zwo digits, f. e. 01
>
> ABCDEFG*********01
>
> 01 can I cut for an other function, now I have ABCDEFG*********
>
> The filled * I can delete for my real ID (ABCDEFG)
>
> left(:str,  position('*' in :str)-1));
>
> It works find, but there are IDs available with * in the middle of the
> ID LFor example ABC*DEFG and I receive this: ABC*DEFG********01
>
> In this case the function will return ABC
>
> How can I get ABC*DEFG, leave the * between C*D, delete all * from right?
>
> Thank you.
>
> Best regards
>
> Olaf
>
> 


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-dig...@yahoogroups.com 
    firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

  • [firebird... 'checkmail' check_m...@satron.de [firebird-support]
    • Re: ... Virna Constantin costel...@yahoo.com [firebird-support]
      • ... 'checkmail' check_m...@satron.de [firebird-support]
        • ... Virna Constantin costel...@yahoo.com [firebird-support]
          • ... Virna Constantin costel...@yahoo.com [firebird-support]
            • ... Virna Constantin costel...@yahoo.com [firebird-support]
          • ... 'checkmail' check_m...@satron.de [firebird-support]
    • Re: ... Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
      • ... 'checkmail' check_m...@satron.de [firebird-support]

Reply via email to