Yes, freezes meaning run very slowly if at all. Ctrl alt del = program
(access) not responding.
The two query statements are essentially the same, the first one posted is
my complete query. The second, I removed the stuff I though was non-essential
in understanding the problem, but I let you see both just in case.
The date thing, (my use is as an actual date in history if that maks any
difference) you mention and I will review the posting you listed but I would
be suprised if it is causing a problem since it works in this query if I drop
eithor the Conference or the Division "filter parameters".
Sorry, for the previous note(below) being misleading. The query has two sets
of conferences and divisions. The away(visitor) team has a conference and a
division it belongs to, as does the home team, each is represented by a
column in the query (total of 4 columns). I can run the query with either the
conference or the division of the home and the away team with a criteria, but
it freezes when I include both the conference and division "filter
parameters" in the criteria for both the away and the home team.
So this works:
SELECT [104 Adjusted Home Scores].ID, [104 Adjusted Home Scores].Date, [104
Adjusted Home Scores].Season, [105 Adjusted Away Scores].Visitor, [105
Adjusted Away Scores].[Home Adjusted Margin], [104 Adjusted Home
Scores].Home, [104 Adjusted Home Scores].[Home Adjusted Score], [104 Adjusted
Home Scores]![Home Adjusted Score]-[105 Adjusted Away Scores]![Home Adjusted
Margin] AS [Adjusted Margin], [Season Division Conference School].Division,
[Season Division Conference School_1].Division, [104 Adjusted Home
Scores].[Home Conference], [105 Adjusted Away Scores].[Visitors Conference],
[104 Adjusted Home Scores].Nuetral, [105 Adjusted Away Scores].Nuetral
FROM [Filter parameters], ([Season Division Conference School] INNER JOIN
[104 Adjusted Home Scores] ON ([Season Division Conference School].School =
[104 Adjusted Home Scores].Home) AND ([Season Division Conference
School].Season = [104 Adjusted Home Scores].Season)) INNER JOIN ([Season
Division Conference School] AS [Season Division Conference School_1] INNER
JOIN [105 Adjusted Away Scores] ON ([Season Division Conference
School_1].School = [105 Adjusted Away Scores].Visitor) AND ([Season Division
Conference School_1].Season = [105 Adjusted Away Scores].Season)) ON [104
Adjusted Home Scores].ID = [105 Adjusted Away Scores].ID
WHERE ((([104 Adjusted Home Scores].Season)=[Filter parameters]![Season])
AND (([Season Division Conference School].Division)=[Filter
parameters]![Division]) AND (([Season Division Conference
School_1].Division)=[Filter parameters]![Division]) AND (([104 Adjusted Home
Scores].Nuetral)=False) AND (([105 Adjusted Away Scores].Nuetral)=False));
this does not(freezes):
SELECT [104 Adjusted Home Scores].ID, [104 Adjusted Home Scores].Date,
[104 Adjusted Home Scores].Season, [105 Adjusted Away Scores].Visitor, [105
Adjusted Away Scores].[Home Adjusted Margin], [104 Adjusted Home
Scores].Home, [104 Adjusted Home Scores].[Home Adjusted Score], [104 Adjusted
Home Scores]![Home Adjusted Score]-[105 Adjusted Away Scores]![Home Adjusted
Margin] AS [Adjusted Margin], [Season Division Conference School].Division,
[Season Division Conference School_1].Division, [104 Adjusted Home
Scores].[Home Conference], [105 Adjusted Away Scores].[Visitors Conference],
[104 Adjusted Home Scores].Nuetral, [105 Adjusted Away Scores].Nuetral
FROM [Filter parameters], ([Season Division Conference School] INNER JOIN
[104 Adjusted Home Scores] ON ([Season Division Conference School].School =
[104 Adjusted Home Scores].Home) AND ([Season Division Conference
School].Season = [104 Adjusted Home Scores].Season)) INNER JOIN ([Season
Division Conference School] AS [Season Division Conference School_1] INNER
JOIN [105 Adjusted Away Scores] ON ([Season Division Conference
School_1].School = [105 Adjusted Away Scores].Visitor) AND ([Season Division
Conference School_1].Season = [105 Adjusted Away Scores].Season)) ON [104
Adjusted Home Scores].ID = [105 Adjusted Away Scores].ID
WHERE ((([104 Adjusted Home Scores].Season)=[Filter parameters]![Season])
AND (([Season Division Conference School].Division)=[Filter
parameters]![Division]) AND (([Season Division Conference
School_1].Division)=[Filter parameters]![Division]) AND (([104 Adjusted Home
Scores].[Home Conference])=[Filter parameters]![Conference]) AND (([105
Adjusted Away Scores].[Visitors Conference])=[Filter
parameters]![Conference]) AND (([104 Adjusted Home Scores].Nuetral)=False)
AND (([105 Adjusted Away Scores].Nuetral)=False));
When you say "the query freezes", am I correct in understanding that to mean
that the query runs very slowly and you "end" it by Ctrl+Break before it
finishes? And that the two AND statements that you reference are these:
(([Season Division Conference School].Division)=[Filter
parameters]![Division]) AND (([Season Division Conference
School_1].Division)=[Filter parameters]![Division]));
Please clarify which "added" criterion is causing the slowdown. You've
posted two separate query statements, and I am not sure which of the two is
the one on which we need to focus. Are you running both?
Also, I note that you're using Date as the name of a field. Date and many
other words are reserved words in ACCESS, and you are well advised to avoid
their use as names of fields or controls. See this Knowledge Base article:
ACC2002: Reserved Words in Microsoft Access
http://support.microsoft.com/default.aspx?scid=kb;en-us;286335
--
Ken Snell
<MS ACCESS MVP>
The whole query is:
SELECT [104 Adjusted Home Scores].ID, [104 Adjusted Home Scores].Date,
[104
Adjusted Home Scores].Season, [105 Adjusted Away Scores].Visitor, [105
Adjusted Away Scores].[Home Adjusted Margin], [104 Adjusted Home
Scores].Home, [104 Adjusted Home Scores].[Home Adjusted Score], [104
Adjusted
Home Scores]![Home Adjusted Score]-[105 Adjusted Away Scores]![Home
Adjusted
Margin] AS [Adjusted Margin], [Season Division Conference
School].Division,
[Season Division Conference School_1].Division, [104 Adjusted Home
Scores].[Home Conference], [105 Adjusted Away Scores].[Visitors
Conference],
[104 Adjusted Home Scores].Nuetral, [105 Adjusted Away Scores].Nuetral
FROM [Filter parameters], ([Season Division Conference School] INNER JOIN
[104 Adjusted Home Scores] ON ([Season Division Conference School].School
=
[104 Adjusted Home Scores].Home) AND ([Season Division Conference
School].Season = [104 Adjusted Home Scores].Season)) INNER JOIN ([Season
Division Conference School] AS [Season Division Conference School_1] INNER
JOIN [105 Adjusted Away Scores] ON ([Season Division Conference
School_1].School = [105 Adjusted Away Scores].Visitor) AND ([Season
Division
Conference School_1].Season = [105 Adjusted Away Scores].Season)) ON [104
Adjusted Home Scores].ID = [105 Adjusted Away Scores].ID
WHERE ((([104 Adjusted Home Scores].Season)=[Filter parameters]![Season])
AND (([Season Division Conference School].Division)=[Filter
parameters]![Division]) AND (([Season Division Conference
School_1].Division)=[Filter parameters]![Division]) AND (([104 Adjusted
Home
Scores].Nuetral)=False) AND (([105 Adjusted Away Scores].Nuetral)=False));
Boiled down to items in question:
SELECT [104 Adjusted Home Scores].Season, [104 Adjusted Home Scores]![Home
Adjusted Score]-[105 Adjusted Away Scores]![Home Adjusted Margin] AS
[Adjusted Margin], [Season Division Conference School].Division, [Season
Division Conference School_1].Division
FROM [Filter parameters], ([Season Division Conference School] INNER JOIN
[104 Adjusted Home Scores] ON ([Season Division Conference School].School
=
[104 Adjusted Home Scores].Home) AND ([Season Division Conference
School].Season = [104 Adjusted Home Scores].Season)) INNER JOIN ([Season
Division Conference School] AS [Season Division Conference School_1] INNER
JOIN [105 Adjusted Away Scores] ON ([Season Division Conference
School_1].School = [105 Adjusted Away Scores].Visitor) AND ([Season
Division
Conference School_1].Season = [105 Adjusted Away Scores].Season)) ON [104
Adjusted Home Scores].ID = [105 Adjusted Away Scores].ID
WHERE ((([104 Adjusted Home Scores].Season)=[Filter parameters]![Season])
AND (([Season Division Conference School].Division)=[Filter
parameters]![Division]) AND (([Season Division Conference
School_1].Division)=[Filter parameters]![Division]));
Hope you can follow this.
The [Filter Parameters] are from a table that gets input from a form.
Having the two AND statements are what seems to get me in trouble.
:
Can you post more details about the queries? Such as the SQL statements
for
them? And the table structures that you're using.
--
Ken Snell
<MS ACCESS MVP>
I have a query that I would like to be able to set the criteria in two
separate fields (say the first is Division and the second is
Conference).
The
conference field is actually a subset of the Division field (meaning
if
the
Conference is "A" it is by defintion a subset of Division "A" ). The
problem
I have is that I can only set one of these fields or my query will
freeze
up.
Ultimately, I want to be able to use a form with a combo box of the
various
Divisions and Conferences to set the query criteria but I can not get
past
this first hurdle - is there something fundementally wrong with having
both
the "parent & daughter" criteria in a query? Is this why my query
freezes?
fyi - if I only use one or the other criteria the query works fine, it
is
only when I use both that I have problems.