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
Migrate from Mac Mini OSX to PC Win 7
System Writer Dissappeared
How to set the position and size for firefox using CreateProcess and MoveWindow (Visual Studio 2008, MFC)
Help with ADHResize.mde and subforms
How do I add missing Active X controls to non-admin accounts in Microsoft Access 2003?
Securing an MMO game against cheaters
SCCM Query for systems with a specific File Name & Specific Version of that file
How can execute an application asynchronously in a trigger/stored procedure?
VMWARE VMDK Guest Blue Screen
ASP.NET 2.0 Datalist and Paging