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 / Reports / Printing / October 2005

Tip: Looking for answers? Try searching our database.

Re:Calculations dropping off,...HELP???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jay - 29 Oct 2005 12:16 GMT
I am running this application in Access 97 and need to show results using
this calculation:

=(IIf([rpt_Product_TequilaInfoData_Collection_PrevDay].[Report].[HasData],[rpt_Product_TequilaInfoData_Collection_PrevDay].[Report]![txt_ActualOnHndSales],0)+IIf([rpt_Product_TequilaInfoData_Collection_PrevDay].[Report].[HasData],[rpt_Product_TequilaInfoData_Collection_PrevDay].[Report]![txt_OpenBtlSales],0))-(IIf([rpt_Product_TequilaInfoData_Collection_Daily].[Report].[HasData],[rpt_Product_TequilaInfoData_Collection_Daily].[Report]![txt_ActualOnHndSales],0)+IIf([rpt_Product_TequilaInfoData_Collection_Daily].[Report].[HasData],[rpt_Product_TequilaInfoData_Collection_Daily].[Report]![txt_OpnBtlSales],0))
=================

What happens is that the first two references are added together, then, the
next two are deducted rom the first two. What I need to do is, if either of
the first two have a value and the the last two do not, show the total of the
first two anyway! The very first value will almost always be a higher value
than the last two, thus, I'd like to show the result of that value minus the
last two, even if the second of the first two values may be missing!

Currently, if any value is missing, I end-up with no results of a blank
space for the control which is to show the results.

I hope that I've explianed what I'm trying to accomplish. If I was not as
clear as I think, then, please post back with further questions on the matter!

Thanks,
Pat Hartman(MVP) - 29 Oct 2005 22:44 GMT
When data that you need to use in calculations may be null, you can use the
Nz() function.
Nz([rpt_Product_TequilaInfoData_Collection_PrevDay].[Report]![txt_ActualOnHndSales],0)
- Just change all the fields this way.  Nz is the Null to Zero function but
if you want it to return any other value, just substitute if for the 0.
Nz(someTextField, "Empty")  or Nz(someNumericField, 245) for example.  The
default is 0 for numeric fields and "" for text fields.  "" is a Zero Length
String.  Do not confuse it with null.

>I am running this application in Access 97 and need to show results using
> this calculation:
[quoted text clipped - 22 lines]
>
> Thanks,
 
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.