PC Review


Reply
Thread Tools Rate Thread

Calculation in reports - negative number

 
 
=?Utf-8?B?RCBOZXltYW4=?=
Guest
Posts: n/a
 
      28th Jun 2006
I am creating a calculation in a report which occassionally creates a
negative number. Is there any way I can place a 0 in this field if a
negative number is generated?
--
D Neyman
 
Reply With Quote
 
 
 
 
Larry Linson
Guest
Posts: n/a
 
      28th Jun 2006
"D Neyman" wrote

> I am creating a calculation in a report
> which occassionally creates a
> negative number. Is there any way I
> can place a 0 in this field if a
> negative number is generated?


IIF ((yourcalculation)<0, 0, (yourcalculation))

replace both instances of (yourcalculation) with your calculation. If you
are doing your calculation in code, you can simplify just by using an

If ... Then
....
End If

structure instead of the IIF, but the IIF will work in a Control Source
expression, too.

Larry Linson
Microsoft Access MVP


 
Reply With Quote
 
fredg
Guest
Posts: n/a
 
      28th Jun 2006
On Tue, 27 Jun 2006 19:09:02 -0700, D Neyman wrote:

> I am creating a calculation in a report which occassionally creates a
> negative number. Is there any way I can place a 0 in this field if a
> negative number is generated?


Use an Unbound control.
Set it's control source to:

=IIf([FieldA]-[FieldB]>0,0,[FieldA]-[FieldB])

Where [FieldA]-[FieldB] represents whatever your actual calculation
is.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
Al Camp
Guest
Posts: n/a
 
      28th Jun 2006
D,
Place this calculation in your field...
=IIF(YourCalculation < 0, 0, YourCalculation)
that should do it.

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"D Neyman" <(E-Mail Removed)> wrote in message
news:C9F73AAD-F04F-481D-B2EE-(E-Mail Removed)...
>I am creating a calculation in a report which occassionally creates a
> negative number. Is there any way I can place a 0 in this field if a
> negative number is generated?
> --
> D Neyman



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Negative Number - Brackets instead of negative signs J. Trucking Microsoft Access 3 29th Apr 2008 08:47 PM
PMT calculation is negative number Edward Owen Microsoft Excel Discussion 3 25th Mar 2007 09:01 PM
DateDiff calculation with criteria returns a negative number Windsorcat via AccessMonster.com Microsoft Access Queries 1 3rd Oct 2006 07:17 PM
2003= negative number&2004= negative number How Do I Calculate gro =?Utf-8?B?SmFzb24=?= Microsoft Excel Worksheet Functions 1 14th Jan 2005 05:24 PM
Re: Importing negative numbers when negative sign is at the back of the number Ken Snell Microsoft Access External Data 3 5th Aug 2003 07:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:48 PM.