inserting a value

  • we have a value that is 10 digits long if you want to select it with a 4 as the first digit, making it 11 digits long how would you do it? its a string by the way, thanks.

  • Hi,

    if you just want to place a 4 as first digit , you can use charindex to determine at which place the '.' is and then put a new string together with left of charindex & '4' and right of charindex.

    As I think a little longer it might work to replace '.' with '.4'. not tested

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

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