Updating Part of Filename

  • Hello Everyone,

    What would be the best way to go about converting a part of this Filename from upper case to lower case?

    FROM: APR0111OFR_AAAAAAAA_01

    TO: Apr0111OFR_AAAAAAAA_01

  • Something like this?

    declare @filename varchar(255)

    set @filename = 'APR0111OFR_AAAAAAAA_01'

    select replace(@filename, substring(@filename,2,2),lower(substring(@filename,2,2)))

  • I do not know what is your exact requirement, however, this piece of code may help you.

    declare @from varchar(50) , @to varchar(50)

    select @from = 'APR0111OFR_AAAAAAAA_01'

    select @to = stuff(@from,2,2, lower(substring(@from,2,2)))

    Print @to

    -----

    Seraj Alam

    Return to scociety from where you received a lot.

  • Thanks so much guys this is greatly appreciated....

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply