DSum rounding issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • txredraider
    New Member
    • Jun 2010
    • 2

    DSum rounding issue

    I am currently using the dsum function to add some fields together given certain criteria. The issue im comining across is this: when the dsum function operates, it automatically rounds the final number. The fields settings are as follows:
    Data Type: Number
    field size: Single
    decimal places: 2

    the code looks like this:
    HRa= Dsum ("[Hours Requested]","TableNam e", "[fieldname1] = '" & VariableCriteri a &"' and [fieldname2] = '" & Variable Criteria & "'")

    (I left out the actually field and table names because the might be consider sensitive information, better safe than sorry!)

    the number should come out either as a whole number, x.5, x.25 or x.75, however all i get is a rounded whole number... any help?
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Never heard of field and table names being considered sensitive information! Thought something had to first be information before it could be sensitive information!

    The fact that the result is coming out a whole number would tend to indicate that HRa is defined as an Integer in the underlying table or at the form level. I'd double check this, first off.

    Welcome to Bytes!

    Linq ;0)>

    Comment

    • txredraider
      New Member
      • Jun 2010
      • 2

      #3
      Originally posted by missinglinq
      Never heard of field and table names being considered sensitive information! Thought something had to first be information before it could be sensitive information!

      The fact that the result is coming out a whole number would tend to indicate that HRa is defined as an Integer in the underlying table or at the form level. I'd double check this, first off.

      Welcome to Bytes!

      Linq ;0)>
      Thanks for the welcome!

      As far as sensitive information goes, i dont want to screw around with OPSEC, so...i just dont risk it.

      I re-checked both the form and underlying table. The form input is a text box bound to the underlying field. The underlying field is definatly set to single,general number,2 (Field size, format and decimal places, respectivaly). I'm really stumped on this one. Everything i looked up about dsum says it shouldn't round any final results, it should just add the fields together, so I really dont know whats going on? I suppose i could put together a loop statement or something, but if its an underlying format issue, that wont solve it. HRa shows up on the table with decimals... and the math is correct, just rounded up if it should in in .5. Any other ideas?

      Comment

      Working...