Progressive sum

cimabue

Registered User.
Local time
Yesterday, 21:19
Joined
Feb 24, 2012
Messages
11
Hello,
Excuse for my English. In a query I entered this formula to calculate the progressive sum sales of single products:
TotProg: DSum ("[a] + "; "Tbl name" "" Date <= "& [Date])
It works perfectly, but this formula calculates the progressive of all the years stored.
I would like to filter the query based on a date chosen by the user (from date… or between..and..) . The progressive has to start only from the date chosen by the user.
Please help me.
Sergio
 
I can't understand how it works perfectly without throwing any mismatch type error....
anyhow the syntax should be like this:

if table name contains spaces (which is not recommended) enclose brackets as well

Code:
TotProg: DSum ("[a] + [b]", "Tbl name", " Date <= #"& [Date] &"#")

hope it helps !:)
 
You may also be having a problem with "Date". Date is the name of a function and so should not be used as a column name. It is possible that Date is being interpreted as the current date rather than the stored value in the Date field. Qualify the name to remove any ambiguity and always enclose it in square brackets. Better yet - change it to be more descriptive. i.e. SaleDate, BirthDate, HireDate, etc.

[tblName].[Date]
 
Martin Green has an excelent 6 part tutorial on "Access and SQL". Parts 4,5 & 6 apply to your situation. http://fontstuff.com/access/index.htm

He shows how to build a pop up box to get the from, to or between dates and then link this to a query and report.
 

Users who are viewing this thread

Back
Top Bottom