wajidpharmacist007
Member
- Local time
- Today, 03:15
- Joined
- Nov 23, 2018
- Messages
- 31
I want to calculate previous month total quantity where generic and category fields are the same the quantity should sum up in access query
In this Generic field type is number while Category field type is short text. I am trying to use this one but this is not working.
Kindly help me how to figure it out.
Thanks
Code:
Last Month Qty: DSum("[Quantity]","[Inventory Transactions Extended]","[Transaction Types].[Add/Remove]='Removal' and [Inventory.Generic] = " & [Generic] and [Inventory].[Category] =’" &[Category]& ”’” and [Inventory Transactions Extended].[Created Date] >#DateSerial(Year(Date()),IIf(Month(Date())=1,12,Month(Date())-1),1)# and [Inventory Transactions Extended].[Created Date] < #DateSerial(Year(Date()),Month(Date()),0)#)
Kindly help me how to figure it out.
Thanks