Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / August 2006

Tip: Looking for answers? Try searching our database.

If a value is negative how to make it equal 0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc - 31 Aug 2006 21:55 GMT
If I do a calculation between two fields and the answer ends up to be
negative how do I make the negative number equal 0.
Rick Brandt - 31 Aug 2006 22:04 GMT
> If I do a calculation between two fields and the answer ends up to be
> negative how do I make the negative number equal 0.

=IIf(YourCurrentExpression < 0, 0, YourCurrentExpression)

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Marc - 31 Aug 2006 22:24 GMT
=IIF([Finished Date Man BR by QA]-[Packaging Date]<0,0 [Finished Date Man BR
by QA]-[Packaging Date])

Is above how I'm suppose to write it? It give me an error "you may have
entered a comma without a preceeding value identifier" Thanks for your help.

> > If I do a calculation between two fields and the answer ends up to be
> > negative how do I make the negative number equal 0.
>
> =IIf(YourCurrentExpression < 0, 0, YourCurrentExpression)
Klatuu - 31 Aug 2006 22:42 GMT
You are just missing a comma.  The construct for an IIf statement is
IIf(condition, True Value, False Value)

=IIF([Finished Date Man BR by QA]-[Packaging Date]<0, 0, [Finished Date Man
BR
by QA]-[Packaging Date])

> =IIF([Finished Date Man BR by QA]-[Packaging Date]<0,0 [Finished Date Man BR
> by QA]-[Packaging Date])
[quoted text clipped - 6 lines]
> >
> > =IIf(YourCurrentExpression < 0, 0, YourCurrentExpression)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.