help w/ trimming column

  • I actually didn't realize how close I was guess tomorow will be the big K...



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • Will be watching .

    Now that I think of it I'm not that far away from the carpal tunnel stage... .

  • Room for another?

    update table set column = select substring(column, 1, len(column) - 4)

  • doesn't validate that it ends with '0000' and it won't work for canadian/europian zip codes

  • Thanks for everyones help I really do appreciate it...

    They are US zip codes, sorry for not clarifying that earlier...

    I'm still not having any luck. It might be because I'm using Oracle SQL Plus (evil oracle), I quess I found a case where MS SQL and Oracle SQL don't like eachother. Sorry for my newbieness

  • What statement are you using? What error are you getting?

  • update mci_geocodable set zipcode_2  = left(zipcode_2,5)

    error "left" invalid identifier

    the '0000' part isn't important as long as I get rid of those last 4 characters, just that 90% of the zip codes had the "0000" at the end and I thought it would be a good place to start.

  • Check the documentation of that product. It will most likely be listed in the string functions section... Look for anything like substring or the likes.

  • Meredith - try ND's solution and see it the substring function is supported:

    update table set zipcode_2 = substring(zipcode_2, 1, 5)

    ...I also think you should definitely include the "where substring(zipcode_2, 6, 4) = '0000'" since you say that 90% of the rows have this...when it's not 100% you should always play it safe but then it's only my opinion...







    **ASCII stupid question, get a stupid ANSI !!!**

Viewing 9 posts - 16 through 23 (of 23 total)

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