Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

Data Type

Discussion in 'Information Technology' started by mpc55155, Jul 28, 2006.

Tags:
  1. mpc55155

    mpc55155
    Expand Collapse
    Guest

    Can the data type for a field be text and number for the same field? I'm
    assigning account numbers as the primary key and some of the accounts are
    number only, some are text and number and some are text only.

    Please help!
     
  2. Loading...


  3. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    mpc55155 wrote:
    > Can the data type for a field be text and number for the same field?
    > I'm assigning account numbers as the primary key and some of the
    > accounts are number only, some are text and number and some are text
    > only.
    >
    > Please help!


    Use Text. Text fields can have digits, but number fields can ONLY have digits.

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  4. mpc55155

    mpc55155
    Expand Collapse
    Guest

    Thank you, however, I'm trying to import an excel spreadsheet, but all the
    account numbers that have text and numbers don't import.

    "Rick Brandt" wrote:

    > mpc55155 wrote:
    > > Can the data type for a field be text and number for the same field?
    > > I'm assigning account numbers as the primary key and some of the
    > > accounts are number only, some are text and number and some are text
    > > only.
    > >
    > > Please help!

    >
    > Use Text. Text fields can have digits, but number fields can ONLY have digits.
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
    >
    >
    >
     
  5. Joseph Meehan

    Joseph Meehan
    Expand Collapse
    Guest

    mpc55155 wrote:
    > Can the data type for a field be text and number for the same field?
    > I'm assigning account numbers as the primary key and some of the
    > accounts are number only, some are text and number and some are text
    > only.
    >
    > Please help!


    No, but you can have two fields one number type and one data type.

    Text fields can have number characters 0123456789 in them, but you can't
    sort on them and expect it to recognize the difference between 0001 and 1
    so 02009 will sort before 2008

    You can have a primary key based on a combination of fields.

    --
    Joseph Meehan

    Dia duit
     
  6. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    Essentially Jet guesses at the data type based on a scan on a fixed number
    of rows. If all it see in the rows that it scans is numbers, it's going to
    pick a numeric data type.

    Your options are to put an alphanumeric field in those rows that are being
    scanned, change the number of rows that are being scanned, or predefine the
    table in Access, and insert the data into that predefined table.

    See
    http://www.dicks-blog.com/archives/2004/06/03/external-data-mixed-data-types/
    for a discussion of option 2 above.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no private e-mails, please)


    "mpc55155" <mpc55155@discussions.microsoft.com> wrote in message
    news:6DDDEF28-5CB5-47CB-B963-1095F7D55ACA@microsoft.com...
    > Thank you, however, I'm trying to import an excel spreadsheet, but all the
    > account numbers that have text and numbers don't import.
    >
    > "Rick Brandt" wrote:
    >
    >> mpc55155 wrote:
    >> > Can the data type for a field be text and number for the same field?
    >> > I'm assigning account numbers as the primary key and some of the
    >> > accounts are number only, some are text and number and some are text
    >> > only.
    >> >
    >> > Please help!

    >>
    >> Use Text. Text fields can have digits, but number fields can ONLY have
    >> digits.
    >>
    >> --
    >> Rick Brandt, Microsoft Access MVP
    >> Email (as appropriate) to...
    >> RBrandt at Hunter dot com
    >>
    >>
    >>
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page