TroyMcClure
Technical User
This is a problem that's I swear I've solved before, but I never can remember what I ended up doing.
I have 2 fields, say [num1] and [num2], which are stored in the db as long integer.
In a report's ControlSource, I try to avg as:
This ALWAYS results in a non-float result (the field is formatted as standard, 1 decimal). Even if I take the actual values in the Debug window:
How do I get it to cast correctly? I've tried all sorts of combinations of using type declaration, explicit conversions, Format(), etc, but the above numbers ALWAYS return 6, in some format or another, not 6.444444....
--T
I have 2 fields, say [num1] and [num2], which are stored in the db as long integer.
In a report's ControlSource, I try to avg as:
Code:
=Csng(Csng([num1])\Csng([num2]))
This ALWAYS results in a non-float result (the field is formatted as standard, 1 decimal). Even if I take the actual values in the Debug window:
Code:
?format(csng(csng(58)\csng(9)),"0.00")
6.00
or
?format(csng(58!\9!),"0.00")
6.00
How do I get it to cast correctly? I've tried all sorts of combinations of using type declaration, explicit conversions, Format(), etc, but the above numbers ALWAYS return 6, in some format or another, not 6.444444....
--T