Hello. I'm trying to create an updatable recordset (DAO or ADO). Here are my tables:
tblWork tblActivity
------- ----------
WorkID(PK) ClientID Date ActivityID(PK) Description
11 100 4/10/06 1 Running
12 100 4/11/06 2 Swimming
13 100 4/13/06 3 Walking
tblHours
--------
WorkID ActivityID Hours
11 1 3
11 2 4
12 1 2
13 1 5
13 3 5
Criteria: capture days 4/10 to 4/13 for a given client
------------------------------
4/10/06 4/11/06 4/12/06 4/13/06
Running 3 2 null 5
Swimming 4 null null null
Walking null null null 5
I've tried crosstabs, but they're not updatable
The only solution I have is to create about 3 queries and build a table based on the queries:
query 1. link and retrieve tblHours-tblWork a client (to check if there was time spent on those days)
query 2. retrieve the tblActivity.Description (Select DISTINCT) for the days and populate a temp table
query 3. populate the temp table with query 1
I've tried to combine these queries into 1 so that it'll be a lot cleaner and easier to maintain but couldn't.
Any ideas for an efficient solution are much appreciated.
tblWork tblActivity
------- ----------
WorkID(PK) ClientID Date ActivityID(PK) Description
11 100 4/10/06 1 Running
12 100 4/11/06 2 Swimming
13 100 4/13/06 3 Walking
tblHours
--------
WorkID ActivityID Hours
11 1 3
11 2 4
12 1 2
13 1 5
13 3 5
Criteria: capture days 4/10 to 4/13 for a given client
------------------------------
4/10/06 4/11/06 4/12/06 4/13/06
Running 3 2 null 5
Swimming 4 null null null
Walking null null null 5
I've tried crosstabs, but they're not updatable
The only solution I have is to create about 3 queries and build a table based on the queries:
query 1. link and retrieve tblHours-tblWork a client (to check if there was time spent on those days)
query 2. retrieve the tblActivity.Description (Select DISTINCT) for the days and populate a temp table
query 3. populate the temp table with query 1
I've tried to combine these queries into 1 so that it'll be a lot cleaner and easier to maintain but couldn't.
Any ideas for an efficient solution are much appreciated.