Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    May 2003
    Location
    Whitmore Lake, MI , USA
    Posts
    84
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Thumbs up

    I'm trying to create a database to track all of our patients that are being treated with oral chemotherapy. I created a table to list the drug name, dose availabe, and the dosage form. When I enter the number into the dose section, anything I enter on the righthand side of the decimal keeps being changed to 0. For example, a drug that comes in a 12.5 mg tablet gets changed to 12 or 12.0. I tried the general number settings, making it a fixed decimal, but no matter how I try to format it, the last digit is being omitted.

    Any ideas on what I did (or didn't do) to cause this to happened? Attached is the file, with only the drugs entered into the table.
    Attached Files Attached Files

  2. #2
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Change the datatype from Long Integer to Single or Double.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  3. #3
    Star Lounger
    Join Date
    May 2003
    Location
    Whitmore Lake, MI , USA
    Posts
    84
    Thanks
    13
    Thanked 0 Times in 0 Posts
    [quote name='SteveH' post='789592' date='18-Aug-2009 13:08']Change the datatype from Long Integer to Single or Double.[/quote]

    It worked! Don't understand why, though. In the future, do I haveto do that everytime I wish to create a decimal number in a table?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    A field with the Byte, Integer or Long Integer data type can only store whole numbers. If you enter a number with decimals in such a field, it will automatically be rounded to the nearest whole number.

    The Single and Double data types are intended for numbers with decimals. So yes, if you want a field to hold numbers with decimals, you must change the field size from Long Integer (the default for number fields) to Single or Double.

  5. #5
    Star Lounger
    Join Date
    May 2003
    Location
    Whitmore Lake, MI , USA
    Posts
    84
    Thanks
    13
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='789597' date='18-Aug-2009 13:25']A field with the Byte, Integer or Long Integer data type can only store whole numbers. If you enter a number with decimals in such a field, it will automatically be rounded to the nearest whole number.

    The Single and Double data types are intended for numbers with decimals. So yes, if you want a field to hold numbers with decimals, you must change the field size from Long Integer (the default for number fields) to Single or Double.[/quote]

    Thanks! Somehow I must have missed that when I hit the F1 button. I'll file that in my brain under "R" for "Remember It!"

Posting Permissions

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