Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Location
    Vermont
    Posts
    53

    Unanswered: Access Vs Excel Help

    I am writing a program that is to be able to bill to the 1/10 of the second. The problem is access does not support the function roundup and yet Excel does. So for example if I take a 31 sec call it becomes .516667, and in Excel if I have this number I can format it to only show one decimal after the deciminal point and by using round up Excel converts this number from .51667 to .6. This is what I am trying to acheive, but I can't see to do with out Excel. I can export the data out to Excel to do this, but is there a way that you can use VB that calls Excel for this functinality that would allow me to do this without the export? Because if I export this data then I will have to import the data back in, and eventually the data will be too large to do this.

    Any suggestions people can make would be greatly appreciated.

    Carley

  2. #2
    Join Date
    Jan 2004
    Posts
    75
    You can use the Round function in VB. Check out VB help.

  3. #3
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    For rounding up to one decimal place, try this, substituting {MyData} for the number you want to round up:

    Sgn( {MyData} ) * Int (-10 * Abs( {MyData} ) ) / 10

  4. #4
    Join Date
    Feb 2003
    Location
    Winston-Salem,NC
    Posts
    34
    You can also set the table properties to the following for the field and it will convert automatically.

    Data Type: Number
    Field Size: Decimal
    Format: Fixed
    Percision: This depend on on how many # places you need. If the
    biggest number you have is say 100 with some decimal
    places then set it to 4 etc...
    Scale: 1
    Remove the defualt value if you don't want 0 entered automatically

    When I created a table like this I could enter .1565772 (example) and it would convert the number to .2 It would not just display it as .2 and when you put the cursor in the field display the .1565772 it will convert the number to .2

    Hope that helps
    B

  5. #5
    Join Date
    Feb 2004
    Location
    Vermont
    Posts
    53

    Smile Access Vs Excell

    I can't changed the properties on the table because the table is linked to an SQL database.

    I did use the formula that reads as follows,

    Sgn({myNumber})*Int(-10*Abs({myNumber}))/10 AND THANK YOU JTRockville!!!!!!!!
    :-) :-) :-)

Posting Permissions

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