I’m looking for some syntax help to remove characters in a string. I have a field called zipcode, which has some different formats in it. I’d like to remove any characters after the first 5.
for example: 12345-1234
would return: 12345
I’ve looked at TRIM() and RTRIM(), but I don’t see how to do the above when I don’t know what the sting contains, other than it’s length?
This might be easier than I’m making it, and it’s not helping that I just confused things by writing the “left most characters”. Sorry about that.
I have a field called zipcode. We’d like to trim the data in that field, for every record in the DB, to have no more than 5 characters. Preferably, the first five.
I agree that removing good, or accurate data is a bad idea.
In this case, the “zip +4” data is not only bad data, but is causing the client problems with the USPS and needs to be removed from those records that have extra characters after the first 5.