ZIPCODE DB ACCESS TO SQL

Discussion in 'ASP .Net' started by DaveF, Sep 29, 2004.

  1. DaveF

    DaveF Guest

    How to I get the db in sql to keep the leading 0's from the import?

    --


    David
    DaveF, Sep 29, 2004
    #1
    1. Advertising

  2. DaveF

    Scott M. Guest

    What data type do you have the SQL field set to? Try setting it to a char
    field.


    "DaveF" <> wrote in message
    news:...
    > How to I get the db in sql to keep the leading 0's from the import?
    >
    > --
    >
    >
    > David
    >
    >
    Scott M., Sep 29, 2004
    #2
    1. Advertising

  3. Make sure you're storing the zip code in a text field of one kind or another
    (char or varchar for example) not a numeric field.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "DaveF" <> wrote in message
    news:...
    > How to I get the db in sql to keep the leading 0's from the import?
    >
    > --
    >
    >
    > David
    >
    >
    Steve C. Orr [MVP, MCSD], Sep 29, 2004
    #3
  4. This point can't be emphasized enough. A Zip Code is NOT a number. It is a
    string containing a sequence of numeric characters. Some Zip Codes include
    hyphens, as in:

    12345-0123

    Some Zip Codes Begin with '0'. If you treat them like numbers, you will
    corrupt the data.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    I get paid good money to
    solve puzzles for a living

    "Steve C. Orr [MVP, MCSD]" <> wrote in message
    news:...
    > Make sure you're storing the zip code in a text field of one kind or

    another
    > (char or varchar for example) not a numeric field.
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD, MVP
    > http://Steve.Orr.net
    >
    >
    > "DaveF" <> wrote in message
    > news:...
    > > How to I get the db in sql to keep the leading 0's from the import?
    > >
    > > --
    > >
    > >
    > > David
    > >
    > >

    >
    >
    Kevin Spencer, Sep 29, 2004
    #4
  5. DaveF

    DaveF Guest

    They are in an access db as a string. I exported it to a excell file and
    imported it to a nvarchar. It got rid of the zero's in the beginning

    --


    David Fetrow
    Helixpoint LLC.
    http://www.helixpoint.com

    "Kevin Spencer" <> wrote in message
    news:...
    > This point can't be emphasized enough. A Zip Code is NOT a number. It is a
    > string containing a sequence of numeric characters. Some Zip Codes include
    > hyphens, as in:
    >
    > 12345-0123
    >
    > Some Zip Codes Begin with '0'. If you treat them like numbers, you will
    > corrupt the data.
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > I get paid good money to
    > solve puzzles for a living
    >
    > "Steve C. Orr [MVP, MCSD]" <> wrote in message
    > news:...
    > > Make sure you're storing the zip code in a text field of one kind or

    > another
    > > (char or varchar for example) not a numeric field.
    > >
    > > --
    > > I hope this helps,
    > > Steve C. Orr, MCSD, MVP
    > > http://Steve.Orr.net
    > >
    > >
    > > "DaveF" <> wrote in message
    > > news:...
    > > > How to I get the db in sql to keep the leading 0's from the import?
    > > >
    > > > --
    > > >
    > > >
    > > > David
    > > >
    > > >

    > >
    > >

    >
    >
    DaveF, Sep 29, 2004
    #5
  6. I suspect Excel clipped the zeros.
    It's notorious for such things.
    Try to make sure Excel sees that data column as a text column.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net



    "DaveF" <> wrote in message
    news:...
    > They are in an access db as a string. I exported it to a excell file and
    > imported it to a nvarchar. It got rid of the zero's in the beginning
    >
    > --
    >
    >
    > David Fetrow
    > Helixpoint LLC.
    > http://www.helixpoint.com
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    >> This point can't be emphasized enough. A Zip Code is NOT a number. It is
    >> a
    >> string containing a sequence of numeric characters. Some Zip Codes
    >> include
    >> hyphens, as in:
    >>
    >> 12345-0123
    >>
    >> Some Zip Codes Begin with '0'. If you treat them like numbers, you will
    >> corrupt the data.
    >>
    >> --
    >> HTH,
    >> Kevin Spencer
    >> .Net Developer
    >> Microsoft MVP
    >> I get paid good money to
    >> solve puzzles for a living
    >>
    >> "Steve C. Orr [MVP, MCSD]" <> wrote in message
    >> news:...
    >> > Make sure you're storing the zip code in a text field of one kind or

    >> another
    >> > (char or varchar for example) not a numeric field.
    >> >
    >> > --
    >> > I hope this helps,
    >> > Steve C. Orr, MCSD, MVP
    >> > http://Steve.Orr.net
    >> >
    >> >
    >> > "DaveF" <> wrote in message
    >> > news:...
    >> > > How to I get the db in sql to keep the leading 0's from the import?
    >> > >
    >> > > --
    >> > >
    >> > >
    >> > > David
    >> > >
    >> > >
    >> >
    >> >

    >>
    >>

    >
    >
    Steve C. Orr [MVP, MCSD], Sep 29, 2004
    #6
  7. DaveF

    Scott M. Guest

    The zeros came off when you brought the data into Excel, since Excel see's
    numbers and automatically formats the cells as numeric. Change the format
    of the cells to text.


    "DaveF" <> wrote in message
    news:...
    > They are in an access db as a string. I exported it to a excell file and
    > imported it to a nvarchar. It got rid of the zero's in the beginning
    >
    > --
    >
    >
    > David Fetrow
    > Helixpoint LLC.
    > http://www.helixpoint.com
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    >> This point can't be emphasized enough. A Zip Code is NOT a number. It is
    >> a
    >> string containing a sequence of numeric characters. Some Zip Codes
    >> include
    >> hyphens, as in:
    >>
    >> 12345-0123
    >>
    >> Some Zip Codes Begin with '0'. If you treat them like numbers, you will
    >> corrupt the data.
    >>
    >> --
    >> HTH,
    >> Kevin Spencer
    >> .Net Developer
    >> Microsoft MVP
    >> I get paid good money to
    >> solve puzzles for a living
    >>
    >> "Steve C. Orr [MVP, MCSD]" <> wrote in message
    >> news:...
    >> > Make sure you're storing the zip code in a text field of one kind or

    >> another
    >> > (char or varchar for example) not a numeric field.
    >> >
    >> > --
    >> > I hope this helps,
    >> > Steve C. Orr, MCSD, MVP
    >> > http://Steve.Orr.net
    >> >
    >> >
    >> > "DaveF" <> wrote in message
    >> > news:...
    >> > > How to I get the db in sql to keep the leading 0's from the import?
    >> > >
    >> > > --
    >> > >
    >> > >
    >> > > David
    >> > >
    >> > >
    >> >
    >> >

    >>
    >>

    >
    >
    Scott M., Sep 30, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Thur

    Need to Format a zipcode into xxxxx-xxxx.

    Jeff Thur, Feb 18, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    177
  2. Jeff Thur
    Replies:
    1
    Views:
    121
    Alvin Bruney [MVP]
    Feb 17, 2005
  3. Irishmaninusa

    Canada ZipCode Finder

    Irishmaninusa, Aug 18, 2003, in forum: ASP General
    Replies:
    1
    Views:
    112
    Aaron Bertrand - MVP
    Aug 18, 2003
  4. William Morris

    Zipcode lookup by proximity...

    William Morris, Jun 9, 2004, in forum: ASP General
    Replies:
    8
    Views:
    184
    Aaron [SQL Server MVP]
    Jun 11, 2004
  5. Mark Ericson

    US Zipcode API for Ruby?

    Mark Ericson, Dec 13, 2005, in forum: Ruby
    Replies:
    9
    Views:
    234
    Paul Duncan
    Dec 15, 2005
Loading...

Share This Page