|
-
Mar 24th, 2005, 05:13 AM
#1
Re: Access Queries
 Originally Posted by njwilli3
Firstly Brian,
Secondly Ecniv,
Not sure exactly what you mean, 1 of my queries looks like the following:
SELECT Count([Delegate].[ID]) AS [Total No Of Male Beneficiaries Helped]
FROM Delegate
WHERE Delegate.ID in ( SELECT Delegate.ID FROM Delegate INNER JOIN Activity ON Delegate.ID = Activity.ID
WHERE ((Delegate.Gender)="Male")
GROUP BY Delegate.ID, Delegate.Client, Activity.Activity
ORDER BY Activity.Activity;
);
Do either of you know how I can speed up my queries as they take around 30 seconds to open. I have over 1500 records??
1500 records? Is that all?????
try:
Code:
SELECT Delegate.Gender, Count([Delegate].[ID]) AS [Total No Of Beneficiaries Helped]
FROM Delegate LEFT JOIN Activity ON Delegate.ID = Activity.ID
GROUP BY Delegate.Gender
HAVING (not (activity.id is null))
Isn't that what you want? Not sure...
You can add to the having bit or put in a where clause.
Not sure why your delegate.ID should be joined to Activity.ID...? Have you got the right fields?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|