W
Winnetou
Hi,
Is there a clever way to speed up query execution? I would like to
create a query that lists activities with the following rule: if no
activity per day, leave blank; if multiple activities per
day, show first.
The tables are:
a. tblWeek:
WkID
1
...
52
b. tblAct:
ActDay ActDesc
02/27/06 Call XYZ
03/06/06 Start ABC
03/07/06 Finish ABC
03/14/06 Work Proj1
....
Ideally, over the week range: 9..11, the query would produce:
Wk Monday Tuesday Wednesday
09 Call XYZ
10 Start ABC Finish ABC
11 Work Proj1
Currently, a query (qryActWk) sorts all tasks by day and creates a week
number fld. This field is used to set up an outer join with tblWeek
(qryActWkLst). To show only one activity per day, I added LAST in
qryActWkLst. However, this criterion will only list one activity per
week.
A work-around would be to create 7 distinct LAST queries (one per day)
and use an union query to show the whole week. But, I would like to
avoid UNION queries due to speed slow down.
Thanks for any insights!
Mark
Is there a clever way to speed up query execution? I would like to
create a query that lists activities with the following rule: if no
activity per day, leave blank; if multiple activities per
day, show first.
The tables are:
a. tblWeek:
WkID
1
...
52
b. tblAct:
ActDay ActDesc
02/27/06 Call XYZ
03/06/06 Start ABC
03/07/06 Finish ABC
03/14/06 Work Proj1
....
Ideally, over the week range: 9..11, the query would produce:
Wk Monday Tuesday Wednesday
09 Call XYZ
10 Start ABC Finish ABC
11 Work Proj1
Currently, a query (qryActWk) sorts all tasks by day and creates a week
number fld. This field is used to set up an outer join with tblWeek
(qryActWkLst). To show only one activity per day, I added LAST in
qryActWkLst. However, this criterion will only list one activity per
week.
A work-around would be to create 7 distinct LAST queries (one per day)
and use an union query to show the whole week. But, I would like to
avoid UNION queries due to speed slow down.
Thanks for any insights!
Mark