Welcome to SPN

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

Sign Up Now!

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
    >>
    >>
    >>
     

Share This Page