I have a ZipCode field that needs to be an integer for query purposes, but it lops off the leading zeroes on zips like 03421. Is there a way to make it allow leading zeroes other than changing the datatype to char?
Make it char(5) or something but with additional CHECK constraint.
------ "There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
After second thought... leave it as an integer. Even if user types 00523, this is interpreted as 523 by default.
This of course assumes leading zeros have no other purposes than being a "filler".
------ "There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.