Date Calculations

M

Muriukis

Help! 1. I want to view my stocks using the system date How do I do it
2. I have 2 tables one called Products the other Sales also I have one form
with two subforms the first subforms shows the products in using the sales
date the other subform shows the products out using the sale date but now i
want to be able to determine the total number of products daily.I have tried
all ways but I can't be able to get the number of previous dates my products
table starts from 22-Feb-07 and I want to know the total products for each
day since using the subforms.Adding the products in and subtracting the
products out Using access 2003
 
D

Douglas J. Steele

You'll need to give a little more detail of your tables, like how you
determine whether it's a product in or out, but generically, you can
determine the total between two days as:

SELECT Sum(ProductQuantity) As TotalQuantity
FROM Sales
WHERE TransactionDate BETWEEN Date1 AND Date2

If you want to know the quantity by day, use something like:

SELECT TransactionDate, Sum(ProductQuantity) As TotalQuantity
FROM Sales
WHERE TransactionDate BETWEEN Date1 AND Date2
GROUP BY TransactionDate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top