Weird result calculation

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
 
S

Stuart McCall

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.
 
B

banem2

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
 
Y

yanto

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top