Show Negatives

  • Thread starter Thread starter dhoover via AccessMonster.com
  • Start date Start date
D

dhoover via AccessMonster.com

The following is a piece of code from one of my reports. The field is set as
a general number with 2 decimal places on the report and set as a double in
the table. It basically says that if the numer in x field fits into catagory
c,e,f or g, then it's a percentage, other wise show as a regular number. The
problem is, it's not showing negavive numbers. Anything less than zero shows
as a zero. How can I get this to show the negatives?

=IIf(Left([category],1) In ('C','E','F','G'),Format([month8]/100,"0.0%"),
Format([month8],"0"))
 
Use named formats:

=IIf(Left([category],1) In
('C','E','F','G'),Format([month8]/100,"Percent"), Format([month8],"General
Number"))
 
I gave this a try, but I'm still getting zeros instead of negatives

Allen said:
Use named formats:

=IIf(Left([category],1) In
('C','E','F','G'),Format([month8]/100,"Percent"), Format([month8],"General
Number"))
The following is a piece of code from one of my reports. The field is set
as
[quoted text clipped - 10 lines]
=IIf(Left([category],1) In ('C','E','F','G'),Format([month8]/100,"0.0%"),
Format([month8],"0"))
 
Very strange. The named formats do handle negatives correctly.

This leads to the conclusion that either the calcuations are not correct, or
else that Access is misunderstanding the calculation results are text (not a
valid number), and therefore concluding that the value is zero.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

dhoover via AccessMonster.com said:
I gave this a try, but I'm still getting zeros instead of negatives

Allen said:
Use named formats:

=IIf(Left([category],1) In
('C','E','F','G'),Format([month8]/100,"Percent"), Format([month8],"General
Number"))
The following is a piece of code from one of my reports. The field is
set
as
[quoted text clipped - 10 lines]
=IIf(Left([category],1) In
('C','E','F','G'),Format([month8]/100,"0.0%"),
Format([month8],"0"))
 
I guess I need to look back at the underlying query:



month5: Max(IIf([RecordDateF]=[reportdate5] And [Availability]>1000,
[availability]/1000)), I've tried

month5: Max(IIf([RecordDateF]=[reportdate5] And [Availability]>1000,Format
(Val([availability])/1000,"General Number")))

and just get blanks instead of zeros or negatives



I gave this a try, but I'm still getting zeros instead of negatives
Use named formats:
[quoted text clipped - 7 lines]
=IIf(Left([category],1) In ('C','E','F','G'),Format([month8]/100,"0.0%"),
Format([month8],"0"))
 
Never mind, I needed to take out the >1000 part, duh!
I guess I need to look back at the underlying query:

month5: Max(IIf([RecordDateF]=[reportdate5] And [Availability]>1000,
[availability]/1000)), I've tried

month5: Max(IIf([RecordDateF]=[reportdate5] And [Availability]>1000,Format
(Val([availability])/1000,"General Number")))

and just get blanks instead of zeros or negatives
I gave this a try, but I'm still getting zeros instead of negatives
[quoted text clipped - 3 lines]
=IIf(Left([category],1) In ('C','E','F','G'),Format([month8]/100,"0.0%"),
Format([month8],"0"))
 
Back
Top