Negative results

R

Roger

I have a query where in a field I have a results from several fields. I want
to know how to show the result if negative in ( ) and not with a -.

thanks
 
T

Tom Ellison

Dear Roger:

Use the Format function, somewhat like this:

Format(-12.34, "$#,##0.00;($#,##0.00)")

Read the online help for the Format function for details.

Tom Ellison
 
J

Jeff Boyce

Roger

That sounds like one of the options you'd have if you checked on the Format
property of that field in the query definition...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

fredg

I have a query where in a field I have a results from several fields. I want
to know how to show the result if negative in ( ) and not with a -.

thanks

In Query Design view, right-click anywhere in the column (on the lower
pane).
Write:
#;(#);0
in the format property line.
Save the change.

See Access Help on
Format property + Number and currency datatype
 
F

fredg

Your field is called FRED

Iif([FRED]<0,"("&abs([FRED])&")",[Fred])
I have a query where in a field I have a results from several fields. I want
to know how to show the result if negative in ( ) and not with a -.

thanks

Hey, Wait a minute!
I'm NEVER less than 0. <g>

Fred
 
T

Tom Ellison

Dear Fred:

The code tests to see if you're still alive.

Tom Ellison


fredg said:
Your field is called FRED

Iif([FRED]<0,"("&abs([FRED])&")",[Fred])
I have a query where in a field I have a results from several fields. I
want
to know how to show the result if negative in ( ) and not with a -.

thanks

Hey, Wait a minute!
I'm NEVER less than 0. <g>

Fred
 
F

fredg

Dear Fred:

The code tests to see if you're still alive.

Tom Ellison

fredg said:
Your field is called FRED

Iif([FRED]<0,"("&abs([FRED])&")",[Fred])

Roger wrote:
I have a query where in a field I have a results from several fields. I
want
to know how to show the result if negative in ( ) and not with a -.

thanks

Hey, Wait a minute!
I'm NEVER less than 0. <g>

Fred

Oh! OK.
In that case shouldn't the expression be:

= Iif([FRED]<0,"("Call 911",[Fred]) :)
 
T

Tom Ellison

Dear Fred,

Some of the finest coding I've ever seen. Nice chuckle, too!

Tom Ellison


fredg said:
Dear Fred:

The code tests to see if you're still alive.

Tom Ellison

fredg said:
On Wed, 26 Apr 2006 11:58:49 -0700, Phil wrote:

Your field is called FRED

Iif([FRED]<0,"("&abs([FRED])&")",[Fred])

Roger wrote:
I have a query where in a field I have a results from several fields.
I
want
to know how to show the result if negative in ( ) and not with a -.

thanks

Hey, Wait a minute!
I'm NEVER less than 0. <g>

Fred

Oh! OK.
In that case shouldn't the expression be:

= Iif([FRED]<0,"("Call 911",[Fred]) :)
 
Top