Decimal/Rounding problem??

C

chrissy2391

I have the following calculated field in my query:
Total Paper: nz([legal 8 1/2 x 14 cost])+nz([ledger 11 x 17 cost])+nz([color
copies total])+nz([colored slip sheets cost])+nz([total paper cost])+nz([misc
paper total])+nz([thermal cost])+nz([spiral cost])+nz([booklets cost])

In some records I am getting, for example, $26.80 when the total should be
$2.68. Seems like a simple rounding issue and I've dealt with this before
but the solution is escaping me this time. Thank you for any help.
 
R

RuralGuy

I'm not sure what the problem is but I believe the default for Nz() is
a zero length string ("") not zero. You might want to have your
Nz()'s return zero for a Null: nz([legal 8 1/2 x 14 cost],0)


I have the following calculated field in my query:
Total Paper: nz([legal 8 1/2 x 14 cost])+nz([ledger 11 x 17 cost])+nz([color
copies total])+nz([colored slip sheets cost])+nz([total paper cost])+nz([misc
paper total])+nz([thermal cost])+nz([spiral cost])+nz([booklets cost])

In some records I am getting, for example, $26.80 when the total should be
$2.68. Seems like a simple rounding issue and I've dealt with this before
but the solution is escaping me this time. Thank you for any help.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
C

chrissy2391

After I posted I realized I left out the zero and fixed that problem. It
just seems odd that all the few records that are wrong the numbers are off by
the one decimal place. $34.80 vs. $3.48.
--
Thank you,
Christine


RuralGuy said:
I'm not sure what the problem is but I believe the default for Nz() is
a zero length string ("") not zero. You might want to have your
Nz()'s return zero for a Null: nz([legal 8 1/2 x 14 cost],0)


I have the following calculated field in my query:
Total Paper: nz([legal 8 1/2 x 14 cost])+nz([ledger 11 x 17 cost])+nz([color
copies total])+nz([colored slip sheets cost])+nz([total paper cost])+nz([misc
paper total])+nz([thermal cost])+nz([spiral cost])+nz([booklets cost])

In some records I am getting, for example, $26.80 when the total should be
$2.68. Seems like a simple rounding issue and I've dealt with this before
but the solution is escaping me this time. Thank you for any help.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

I take it that resolved this issue? Good job!

After I posted I realized I left out the zero and fixed that problem. It
just seems odd that all the few records that are wrong the numbers are off by
the one decimal place. $34.80 vs. $3.48.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Top