M
Mikael Lindqvist
Hi everyone,
What I'm asking for here would be so easy in Excel but my skill in Access
just doesn't cut it yet.
I have 2 tables, first table (Table1) only contain one field (a list of
dates, starting from "2005-01-01" and ending "2007-10-31"). The second table
(Table2) has 3 fields:
* Date1
* Date2
* Amount (values ranging from 0 to 1200 USD)
Now, I want to run a conditional sum for each date in Table1.
For example, for first value in Table1: "2005-01-01" I want to run a query
that adds up the values of all transactions in Table 2 that have "2005-01-01"
in the interval between "Date1" and "Date2".
That is, in Table2:
Date1, Date2, Value
2004-12-10 2005-05-01 279
2005-01-01 2005-01-02 300
2005-01-02 2005-01-10 500
Would add up the first 2 as "2005-01-01" is in their interval, thus, the
query would return 579 next to "2005-01-01" (assuming there are no more
transactions in this interval).
And so on for all the other dates (2005-01-02 -- 2007-10-31).
Any help as usual much appreciated!
Kindly,
Mikael
Sweden
What I'm asking for here would be so easy in Excel but my skill in Access
just doesn't cut it yet.
I have 2 tables, first table (Table1) only contain one field (a list of
dates, starting from "2005-01-01" and ending "2007-10-31"). The second table
(Table2) has 3 fields:
* Date1
* Date2
* Amount (values ranging from 0 to 1200 USD)
Now, I want to run a conditional sum for each date in Table1.
For example, for first value in Table1: "2005-01-01" I want to run a query
that adds up the values of all transactions in Table 2 that have "2005-01-01"
in the interval between "Date1" and "Date2".
That is, in Table2:
Date1, Date2, Value
2004-12-10 2005-05-01 279
2005-01-01 2005-01-02 300
2005-01-02 2005-01-10 500
Would add up the first 2 as "2005-01-01" is in their interval, thus, the
query would return 579 next to "2005-01-01" (assuming there are no more
transactions in this interval).
And so on for all the other dates (2005-01-02 -- 2007-10-31).
Any help as usual much appreciated!
Kindly,
Mikael
Sweden