Weird result calculation

  • Thread starter Thread starter yanto
  • Start date Start date
Y

yanto

Hi,
I have this formula ([WorkingDay]-[UnPaidLeave]/30)* 1413000, if
[workingDay]=1 and [UnPaidleave]=1, the result should be 1365900, but
my program give me 1365947.10
can anybody help me to solve this problem?
TIA
Yanto
 
yanto said:
Hi,
I have this formula ([WorkingDay]-[UnPaidLeave]/30)* 1413000, if
[workingDay]=1 and [UnPaidleave]=1, the result should be 1365900, but
my program give me 1365947.10
can anybody help me to solve this problem?
TIA
Yanto

WorkingDay and UnPaidLeave ought to be Long data type. That will give the
required result.
 
Hi,
I have this formula ([WorkingDay]-[UnPaidLeave]/30)* 1413000, if
[workingDay]=1  and [UnPaidleave]=1, the result should be 1365900, but
my program give me 1365947.10
can anybody help me to solve this problem?
TIA
Yanto

WorkingDay and UnPaidLeave ought to be Long data type. That will give the
required result.

Long data type does not have decimal part of the number
(-9223372036854775808 through 9223372036854775807). Instead he should
use double data type (http://msdn.microsoft.com/en-us/library/
y595sc15.aspx).

Quick fix:

(CDbl([WorkingDay])-CDbl([UnPaidLeave]/30))* 1413000

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
Thanks guys, it works

news:78ec1f68-2ed0-4153-b238-abbf55b95419@y13g2000yqn.googlegroups.com...
Hi,
I have this formula ([WorkingDay]-[UnPaidLeave]/30)* 1413000, if
[workingDay]=1 and [UnPaidleave]=1, the result should be 1365900, but
my program give me 1365947.10
can anybody help me to solve this problem?
TIA
Yanto
WorkingDay and UnPaidLeave ought to be Long data type. That will give the
required result.

Long data type does not have decimal part of the number
(-9223372036854775808 through 9223372036854775807). Instead he should
use double data type (http://msdn.microsoft.com/en-us/library/
y595sc15.aspx).

Quick fix:

(CDbl([WorkingDay])-CDbl([UnPaidLeave]/30))* 1413000

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
Back
Top