Results 1 to 3 of 3

Thread: Data Type for Zip Code ?

  1. #1
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default Data Type for Zip Code ?

    Char 5

    Varchar 5

    Int 5

    I don't care about the ZIP + 4.

    I think Char 5 is best, but I'd like conformation / suggestions.

    Thanks.

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Use varchar if the field can be empty.

    If the zipcode is a mandatory field then I don't think there is any difference between char and varchar as the field is going to have some value whose min and max length will be 5.

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by codeexploiter View Post
    min and max length will be 5.
    provided it's only used by USA users; If the zip/post code field is for use in other parts of the world, I would suggest you make it a non-required field, as there are some "states" that do not have postal codes.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •