Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSUM Function (Access Reports)

Status
Not open for further replies.

mouseman

Instructor
Apr 28, 2002
44
US
I have an Access reports that totals Order Qty. I have a Grand total for the report. Also under the grand total i have a total EX Quantity and Mi Quantity I get those qauntities using the Dsum Function. Now here is my question i would like to minus EX and Mi Quantity from the grand total. I used this formula =Sum([OQTY])-DSum("[OQTY]","My Domain","[OTYP]=EX'")-DSum("[OQTY]","My domain","[OTYP]=MI'"). This formula does work, but sometimes it does not. It does not work if one quantity is found and the other quantity is not found. When this happens it leaves an empty space. When both quantities are found, it does it correctly. So is there way, that the formula will work all the time. Thanks you for your help

 
I believe you have Null value issue in your formula
May be this will help.

=Sum(Nz([OQTY]))-DSum("Nz([OQTY])","My Domain","Nz([OTYP])=EX'")-DSum("Nz([OQTY])","My domain","Nz([OTYP])=MI'").
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top