472,125 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 software developers and data experts.

Displaying negative values in a report with parentheses around them

119 100+
This is probably very easy, but I can't see how you would do this...

I have a table that is used as a source table for a report. The table contains percentage values. In the report, I would like to display percentage values less than zero with parentheses around them. I can change the color, format etc. but I'm not sure how you would enclose a particular field in this way.

e.g. -5.6% becomes (5.6%)
Nov 8 '07 #1
6 8888
Jim Doherty
897 Expert 512MB
This is probably very easy, but I can't see how you would do this...

I have a table that is used as a source table for a report. The table contains percentage values. In the report, I would like to display percentage values less than zero with parentheses around them. I can change the color, format etc. but I'm not sure how you would enclose a particular field in this way.

e.g. -5.6% becomes (5.6%)

Create a query and place the numeric field in the query grid now in the column to the right of that type this (where 'pcent' represents your field name). You could then base your report on the query (obviously you would add other fields from your table to do that.

The calculated column strPercent then becomes available in your report as a string value in addition to your numeric value so you have the best of both worlds

Expand|Select|Wrap|Line Numbers
  1. strPercent: "(" & CStr([pcent]) & "%)"
Regards

Jim :)
Nov 8 '07 #2
billelev
119 100+
Thanks, Jim. So I guess it is not possible to do it directly in the report itself, then?
Nov 8 '07 #3
Jim Doherty
897 Expert 512MB
Thanks, Jim. So I guess it is not possible to do it directly in the report itself, then?

I personally always make reports based on queries, the queries of which I make give me the data to provide for the report.

You can do this in the report only if you wish, but it would be a calculated control like a textbox that would take the value of whatever is in the percent textbox and format it in much the same way ie in an unbound textbox enter into its controlsource

Expand|Select|Wrap|Line Numbers
  1.  ="(" & CStr([pcent]) & "%)"
Jim :)
Nov 8 '07 #4
missinglinq
3,532 Expert 2GB
Actually, you can do this in a report, a form or a table (anywhere where the Format property is available) for currency/number datatype fields by placing

0;(0)

in the Format property!

Linq ;0)>
Nov 8 '07 #5
billelev
119 100+
Actually, you can do this in a report, a form or a table (anywhere where the Format property is available) for currency/number datatype fields by placing

0;(0)

in the Format property!

Linq ;0)>
Perfect! That is exactly what I was looking for. Thanks.
Nov 9 '07 #6
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Nov 9 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

34 posts views Thread by Sona | last post: by
39 posts views Thread by Frederick Gotham | last post: by
1 post views Thread by jeffrey.bergstedt | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.