Insert "-" before "char10" field that has trailing spaces

  • How can I insert a "-" into "char10" field that has trailing spaces ?

    I tried the following but it failed ?

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

    UPDATE US_ZIP_temp

    SET Longitude = '-' + Longitude, ZIP = '94949'

    WHERE (ZIP = '94949')

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

    Current Longitude = 152.56

    Desired Longitude = -152.56

  • It looks like you are trying to insert into a char or varchar field from the code, but I am guessing this is actually a numeric field. 

     

    try multiplying Longitude by negative one. 

    I wasn't born stupid - I had to study.

  • I am sorry.  You did say it was a char(10) field. 

    I tried this with a char(10) and it worked fine. 

    I wasn't born stupid - I had to study.

  • Thanks

    It works . . .

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

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