DSUM Function Criteria (1 Viewer)

wajidpharmacist007

New member
Local time
Tomorrow, 00:09
Joined
Nov 23, 2018
Messages
9
I am new to access and have small inventory database in which i have two queries category wise consumption having fields ID, Item, and Category and other query Pending Purchase Requisition Query having fields ID, Item, PR Date, PR QTY, and GRN No.
I want to sum PR Qty of each item present in Purchase requisition Query for one month in report.
Formula that i am using is =Dsum("[PR Qty]","[Purchase Requisition Query]","[PR Date]>#08/01/2019# and [PR Date]<#08/31/2019# and [ID] = " & [ID])
When i run the query resulted fields are blank PR Qty is not summed up
Kindly guide
 

Gasman

Enthusiastic Amateur
Local time
Today, 21:09
Joined
Sep 21, 2011
Messages
6,037
Put your criteris into a string variable and then debug.print that to get it correct
Code:
strwhere = "[Date] >#08/01/2018# and [Date] <#08/31/2018# AND ID > " & tt
? dsum("Amount","Transactions",strwhere)
HTH
 

theDBguy

I’m here to help
Local time
Today, 13:09
Joined
Oct 29, 2018
Messages
10,819
When you get this to work, your query might run very slow. There may be another way to get what you want, but we'll probably need to know more about your database to offer an alternative.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom