Display decimals on query

  • Thread starter Thread starter Mya48
  • Start date Start date
M

Mya48

I have a query that I would like to show two or three decimal places on a
field. What data type should I be using on my tables properties to be able
to show this? My fields are not currency fields. Any help would be
appreciated.

Thanks
 
On Fri, 20 Mar 2009 08:46:01 -0700, Mya48 <Display decimals on
I have a query that I would like to show two or three decimal places on a
field. What data type should I be using on my tables properties to be able
to show this? My fields are not currency fields. Any help would be
appreciated.

Thanks

Number... Single will allow up to seven or eight digits of precision;
Number... Double about thirteen or fourteen; Number... Decimal will let you
specify how many digits and how many decimal places you want.

Currency datatype fields needn't be restricted to money data; a Currency field
is a scaled huge integer with exactly four decimal places and no roundoff
error (a possible problem with Single or Double).
 
Set the number fields to Double. That will allow decimals to be stored. Of
course that doesn't mean they will show up in the query that way. You may
need to format the returned data especially if you want 0's to show up when
there aren't any decimals stored for that record.
 
I tried that but no luck. Could it have something to do with my calculated
field?
This is what's in the calculated field on my query:
Total: Sum([UnitsDisbursed]\Products.QuantityPerUnit)
 
You probably need [ ] around Products.QuantityPerUnit like

[Products].[QuantityPerUnit]

or just [QuantityPerUnit]
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Display decimals on query said:
I tried that but no luck. Could it have something to do with my calculated
field?
This is what's in the calculated field on my query:
Total: Sum([UnitsDisbursed]\Products.QuantityPerUnit)

Jerry Whittle said:
Set the number fields to Double. That will allow decimals to be stored. Of
course that doesn't mean they will show up in the query that way. You may
need to format the returned data especially if you want 0's to show up when
there aren't any decimals stored for that record.
 
You are using the integer division operator "\". Try using the standard
division operator "/".

Integer division only returns whole numbers.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

I tried that but no luck. Could it have something to do with my calculated
field?
This is what's in the calculated field on my query:
Total: Sum([UnitsDisbursed]\Products.QuantityPerUnit)

Jerry Whittle said:
Set the number fields to Double. That will allow decimals to be stored. Of
course that doesn't mean they will show up in the query that way. You may
need to format the returned data especially if you want 0's to show up when
there aren't any decimals stored for that record.
 
Thank you very much. It works great. I would have never caught that.

John Spencer said:
You are using the integer division operator "\". Try using the standard
division operator "/".

Integer division only returns whole numbers.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

I tried that but no luck. Could it have something to do with my calculated
field?
This is what's in the calculated field on my query:
Total: Sum([UnitsDisbursed]\Products.QuantityPerUnit)

Jerry Whittle said:
Set the number fields to Double. That will allow decimals to be stored. Of
course that doesn't mean they will show up in the query that way. You may
need to format the returned data especially if you want 0's to show up when
there aren't any decimals stored for that record.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

I have a query that I would like to show two or three decimal places on a
field. What data type should I be using on my tables properties to be able
to show this? My fields are not currency fields. Any help would be
appreciated.

Thanks
 
Back
Top