Question : Link Tables by Date Range in MS Access

I have two tables, one with cleint, start date, and end date.  The other table has daily values for multiple clients.  I would like to link the two whereby I get the daily values for each client for that client's specific start date and end date.  For example, if my first table has the following:
Client      Start Date      End Date
A      1/1/09      3/1/09
B      2/1/09      5/7/09
C      7/6/09      12/15/09

And my second table has:
Client      Date      Value
A      1/1/09      555.55
A      1/2/09      555.55
A      1/3/09      555.55
A      1/4/09      555.55
B      2/1/09      666.66
B      2/2/09      666.66
B      2/3/09      666.66
B      2/4/09      666.66
B      2/5/09      666.66
B      2/6/09      666.66

I would like the results to be the values from Table 2 for client A from 1/1 to 1/4; and for client B from 2/1 to 2/6.

I considered linking the two tables by client and then using the DLookup function to get the start and end date criteria, but that will only give me the first start and end date in the table, not for the specific client.

Does anyone know if this is feasible?

Thank you.

Answer : Link Tables by Date Range in MS Access

hi kaypatrick, try...

select t2.*
from table2 t2
    inner join table1 t1 on t2.client = t1.client
where t2.date between t1.[start date] and t1.[end date]
Random Solutions  
 
programming4us programming4us