R
Rich
OK, I have read the previous posts and put into Access. All works fine for
the most part, but a couple of entries give rise to strange results.
I have 2 fields:
[Net_Amount] being the amount of an item before tax ($#,##0.00)
[GST_Flag] being a yes/no field to indicate if I need to add 10% tax
I need to round the amounts up to the nearest cent.
Formula I am using is:
=IIf([NetAmount]*IIf([GST_Flag],1.1,1)*100=Int([NetAmount]*IIf([GST_Flag],1.1,1)*100),[NetAmount]*IIf([GST_Flag],1.1,1)*100,Int([NetAmount]*IIf([GST_Flag],1.1,1)*100+1))/100
Essentially, this gives me a roundup to the nearest cent including a 10% tax
if the flag is ticked. Tested it and it work fine. for example,
$123.45 plus tax comes out as $135.80
However, $100.00 does not work. This comes out as $100.01. Dont ask me why
and I have tried and tried, but Int(100*1.1) does not equal 100*1.1 in my
copy of Access 97. I am using SR-2.
Anyone any ideas? Can anyone else recreate this error?
Please help!!! Why couldn't Access have a RoundUp function built in?
the most part, but a couple of entries give rise to strange results.
I have 2 fields:
[Net_Amount] being the amount of an item before tax ($#,##0.00)
[GST_Flag] being a yes/no field to indicate if I need to add 10% tax
I need to round the amounts up to the nearest cent.
Formula I am using is:
=IIf([NetAmount]*IIf([GST_Flag],1.1,1)*100=Int([NetAmount]*IIf([GST_Flag],1.1,1)*100),[NetAmount]*IIf([GST_Flag],1.1,1)*100,Int([NetAmount]*IIf([GST_Flag],1.1,1)*100+1))/100
Essentially, this gives me a roundup to the nearest cent including a 10% tax
if the flag is ticked. Tested it and it work fine. for example,
$123.45 plus tax comes out as $135.80
However, $100.00 does not work. This comes out as $100.01. Dont ask me why
and I have tried and tried, but Int(100*1.1) does not equal 100*1.1 in my
copy of Access 97. I am using SR-2.
Anyone any ideas? Can anyone else recreate this error?
Please help!!! Why couldn't Access have a RoundUp function built in?