I am trying to query my access database and import the results into Excel via VBA.
The table I am querying has clients, the daily contribution that they pay, the date the contribution starts from. Client contributions change over and may change in the middle of a month. I am trying to write a report where the user chooses a month and their exact contributions can be calculated. However, their can be several changes in contributions per month. To get the contributions for a particular month I have a query that selects the maximum date before the end of the month for each client. I then need to join that query to the table that has the data about the contribution amounts.
My first query (for the month of April) is along the lines of
select clientID, Max (PeriodStart) from tblClientTransPeriods
where PeriodStart <#05/01/2005#
I then want to join the results of that query to the same table to pull out the contribution amounts that I need.
Can I create a temporary table in memory at run time to create the first query and then join my table to the temp table - this is a thing I used to do a lot in Ingres SQL?
If not, does anyone have any kind suggestions as to how is best to go about getting my recordset?
Many thanks in advance