Microsoft
Software
Hardware
Network
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
Export data from Access to multiple Excel files using a filtered string from a drop down list on a form
Databinding drop-down controls, order of events issue...
Setting filter on sub report
Disconnected network drive connects again at logon
Datepart / Week part in reverse
Viewing Crystal Reports in an MFC SDI Application
School Timetable in MS Excel
The difference between the server types "Web Front End" and "Stand-alone?"
Problem with insert into query..
Error Handler won't close forms