Sum if between 2 dates

I'm creating a basic inventory app. I want to add the ability to track the usage per month of each of the 5 items I am inventorying and display this as a table. 

I have a form set up to log the use of items which updates the total inventory, but I cannot figure out how to count the items, by their item number and by the month the depletion was logged. 

0 1 79
1 REPLY 1

Set up a child table to the inventory table, which I assume has the item field either as its key or a ref to a separate items table.

The child table should have the following fields

  • id -> UNIQUEID()
  • ref to the parent table
  • year -> 4 digit number
  • month -> ENUM of numbers from 1 to 12
  • VC - monthly consumption with 
    SUM(
     SELECT(
      log[used qty], 
      AND(
       YEAR([log date]) = [_THISROW].[year], 
       MONTH([log date] = [_THISROW].[month], 
       [item]=[_THISROW].[ref to parent].[item] //if the inventory table's key is tbe item, then [_THISROW].[ref to parent] should be sufficient
      )
     )
    )
Top Labels in this Space