Hi all,
I have a table containing the details of the sold quantities of a particular Item to a Customer;
Field1: CustomerNumber
Field2: Customer Name
Field3: ItemNumber
Field4: Sep-03 (the whole column contains the quantity of a given item sold to a given customer in the Month September-2003)
Field5: Oct-03 (same as Sep-03, only for October 2003)
Field6: Nov-03
Field7: Dec-03
What I want to run is a query that asks the runner to enter a beginning period and ending period, and Access in turn takes the sum of the data in the given range.
I have tried almost everything what I was capable of, but with no result I can manage to use the “+” operator to sum up the values of fields, but then I have to type in the field my self;
TotalSales: [Sep-03] + [Oct-03] + [Nov-03] + [Dec-03]
But this approach is inflexible and does not allow the user to select just a period. I’m familiar with Excel, and in excel it would be easy to do something like this; SUM(A). In this case it sums up all the data in Rows A to D. Using the Offset function, you can make this also dynamic. But how can I manipulate the same procedure with Access? There are SUM and DSUM functions, but they don’t operate the same way; for example, I cannot type in a empty field in a query;
TotalSales: SUM([Sep-03]:[Dec-03]). It gives a syntax error.
This is also not possible, same error
TotalSales: SUM([Enter beginning date:]:[Enter ending date:])
Could anybody help me with this?? Any suggestions would be welcome and really really appreciated.
Thanks!
Zurvy
I have a table containing the details of the sold quantities of a particular Item to a Customer;
Field1: CustomerNumber
Field2: Customer Name
Field3: ItemNumber
Field4: Sep-03 (the whole column contains the quantity of a given item sold to a given customer in the Month September-2003)
Field5: Oct-03 (same as Sep-03, only for October 2003)
Field6: Nov-03
Field7: Dec-03
What I want to run is a query that asks the runner to enter a beginning period and ending period, and Access in turn takes the sum of the data in the given range.
I have tried almost everything what I was capable of, but with no result I can manage to use the “+” operator to sum up the values of fields, but then I have to type in the field my self;
TotalSales: [Sep-03] + [Oct-03] + [Nov-03] + [Dec-03]
But this approach is inflexible and does not allow the user to select just a period. I’m familiar with Excel, and in excel it would be easy to do something like this; SUM(A). In this case it sums up all the data in Rows A to D. Using the Offset function, you can make this also dynamic. But how can I manipulate the same procedure with Access? There are SUM and DSUM functions, but they don’t operate the same way; for example, I cannot type in a empty field in a query;
TotalSales: SUM([Sep-03]:[Dec-03]). It gives a syntax error.
This is also not possible, same error
TotalSales: SUM([Enter beginning date:]:[Enter ending date:])
Could anybody help me with this?? Any suggestions would be welcome and really really appreciated.
Thanks!
Zurvy