Multiple Decimal Place Formats on Report

  • Thread starter Thread starter PPCO
  • Start date Start date
P

PPCO

I want to format a number on a report so that if it is greater than 50, then
it has 0 decimal places, but if it's less than 50 it has 2 decimal places. I
tried a couple of expressions that I found here, but couldn't get it to work.
Thanks
 
I want to format a number on a report so that if it is greater than 50, then
it has 0 decimal places, but if it's less than 50 it has 2 decimal places. I
tried a couple of expressions that I found here, but couldn't get it to work.
Thanks

Using an unbound control, try:
=IIf([FieldName]>=50,Format([FieldName],"#"),Format([FieldName],"#.00"))
 
It says syntax error comma in expression.

fredg said:
I want to format a number on a report so that if it is greater than 50, then
it has 0 decimal places, but if it's less than 50 it has 2 decimal places. I
tried a couple of expressions that I found here, but couldn't get it to work.
Thanks

Using an unbound control, try:
=IIf([FieldName]>=50,Format([FieldName],"#"),Format([FieldName],"#.00"))
 
If you have a version of Access using something other than the US conventions,
you may need to replace the commas in this expression with semicolons.
It says syntax error comma in expression.

fredg said:
I want to format a number on a report so that if it is greater than 50, then
it has 0 decimal places, but if it's less than 50 it has 2 decimal places. I
tried a couple of expressions that I found here, but couldn't get it to work.
Thanks

Using an unbound control, try:
=IIf([FieldName]>=50,Format([FieldName],"#"),Format([FieldName],"#.00"))
 
As an alternative:

=format(x,iif(x>50,"0","0.00"))

fredg said:
I want to format a number on a report so that if it is greater than 50,
then
it has 0 decimal places, but if it's less than 50 it has 2 decimal
places. I
tried a couple of expressions that I found here, but couldn't get it to
work.
Thanks

Using an unbound control, try:
=IIf([FieldName]>=50,Format([FieldName],"#"),Format([FieldName],"#.00"))
 
Where do I use this expression? In the control source?

Klatuu said:
As an alternative:

=format(x,iif(x>50,"0","0.00"))

fredg said:
I want to format a number on a report so that if it is greater than 50,
then
it has 0 decimal places, but if it's less than 50 it has 2 decimal
places. I
tried a couple of expressions that I found here, but couldn't get it to
work.
Thanks

Using an unbound control, try:
=IIf([FieldName]>=50,Format([FieldName],"#"),Format([FieldName],"#.00"))
 
Yes

PPCO said:
Where do I use this expression? In the control source?

Klatuu said:
As an alternative:

=format(x,iif(x>50,"0","0.00"))

fredg said:
On Thu, 23 Oct 2008 09:18:26 -0700, PPCO wrote:

I want to format a number on a report so that if it is greater than
50,
then
it has 0 decimal places, but if it's less than 50 it has 2 decimal
places. I
tried a couple of expressions that I found here, but couldn't get it
to
work.
Thanks

Using an unbound control, try:
=IIf([FieldName]>=50,Format([FieldName],"#"),Format([FieldName],"#.00"))
 
Back
Top