• ronan.healy (8/27/2014)


    sorry I ment the text before the date.

    that's the text I want to take

    so its like this now BNY Mellon - 07/01/2014

    and I want it like this BNY Mellon

    DECLARE @MyString VARCHAR(200) = 'BNY Mellon - 07/01/2014'

    SELECT LEFT(@MyString, LEN(@MyString)-LEN(' - 07/01/2014'))

    SELECT LEFT(@MyString, LEN(@MyString)-13)

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden