Decimal places in calculated fields

G

Guest

I have a query which takes two fields from a table ([MinimumBid] and
[BidIncrement]) to come up with a calculated field in the query...Bid2:
([MinimumBid]*[BidIncrement]). The [MinimumBid] and [BidIncrement] fields
are formatted with 0 decimal places and that's how they show in the query.
However, the calculated Bid2 field always shows the number with two decimal
places. Is there a way to format in the query so the [Bid2] field has zero
decimal places?

Thanks for your help.

Kevin D.
 
G

Guest

That didn't work. Any other suggestions out there?

Kevin D.

Ofer Cohen said:
Try

Round([Bid2])

--
Good Luck
BS"D


Kevin D. said:
I have a query which takes two fields from a table ([MinimumBid] and
[BidIncrement]) to come up with a calculated field in the query...Bid2:
([MinimumBid]*[BidIncrement]). The [MinimumBid] and [BidIncrement] fields
are formatted with 0 decimal places and that's how they show in the query.
However, the calculated Bid2 field always shows the number with two decimal
places. Is there a way to format in the query so the [Bid2] field has zero
decimal places?

Thanks for your help.

Kevin D.
 
G

Guest

Can you post the SQL you tried?

The Round function should round the number, but if you are using it in
devision then it possible you'll get decimal places, unless you use the round
on the formula

Round([Field1] * [Field2] / [Field3])

Also try
Int([MyNumber])

Or
Format([MyNumber],"#")

--
Good Luck
BS"D


Kevin D. said:
That didn't work. Any other suggestions out there?

Kevin D.

Ofer Cohen said:
Try

Round([Bid2])

--
Good Luck
BS"D


Kevin D. said:
I have a query which takes two fields from a table ([MinimumBid] and
[BidIncrement]) to come up with a calculated field in the query...Bid2:
([MinimumBid]*[BidIncrement]). The [MinimumBid] and [BidIncrement] fields
are formatted with 0 decimal places and that's how they show in the query.
However, the calculated Bid2 field always shows the number with two decimal
places. Is there a way to format in the query so the [Bid2] field has zero
decimal places?

Thanks for your help.

Kevin D.
 
G

Guest

BS"D,

I got it to work, but the original formatting was in currency ($). Can I
get it to show as currency with zero decimal places?

Thanks again.

Kevin D.

Ofer Cohen said:
Try

Round([Bid2])

--
Good Luck
BS"D


Kevin D. said:
I have a query which takes two fields from a table ([MinimumBid] and
[BidIncrement]) to come up with a calculated field in the query...Bid2:
([MinimumBid]*[BidIncrement]). The [MinimumBid] and [BidIncrement] fields
are formatted with 0 decimal places and that's how they show in the query.
However, the calculated Bid2 field always shows the number with two decimal
places. Is there a way to format in the query so the [Bid2] field has zero
decimal places?

Thanks for your help.

Kevin D.
 
G

Guest

Try

Format([FieldName],"$#")

--
Good Luck
BS"D


Kevin D. said:
BS"D,

I got it to work, but the original formatting was in currency ($). Can I
get it to show as currency with zero decimal places?

Thanks again.

Kevin D.

Ofer Cohen said:
Try

Round([Bid2])

--
Good Luck
BS"D


Kevin D. said:
I have a query which takes two fields from a table ([MinimumBid] and
[BidIncrement]) to come up with a calculated field in the query...Bid2:
([MinimumBid]*[BidIncrement]). The [MinimumBid] and [BidIncrement] fields
are formatted with 0 decimal places and that's how they show in the query.
However, the calculated Bid2 field always shows the number with two decimal
places. Is there a way to format in the query so the [Bid2] field has zero
decimal places?

Thanks for your help.

Kevin D.
 
M

Michel Walsh

Note that the format does NOT modify the formatted value, JUST the displayed
one.

? Format( 14.6, "#"), Format( 5.6, "#"), Format( 14.6*5.6, "#")
15 6 82

while clearly, 15*6 <> 82.

You have to truncate, or round, the values BEFORE using them later, as here,
using them later on inside the multiplication:

? Round(14.6) * Round(5.6)
90


else, the result will look incorrect (such as a displayed 15 time a
displayed 6 giving a displayed 82).
 

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