DSUM Function Criteria (1 Viewer)

Local time
Tomorrow, 02:26
Joined
Nov 23, 2018
Messages
31
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, 22:26
Joined
Sep 21, 2011
Messages
14,048
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
Staff member
Local time
Today, 15:26
Joined
Oct 29, 2018
Messages
21,358
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

Top Bottom