G
Guest
I am not sure if there is a way of speeding this up, or if I am just trying
to do too much.
Problem: The problem is that it runs pretty slow. As well I can run the
report as many times as I like, but as soon as I run the report then go into
the rpt design view, then try and run the report again it gives me the error
"cannot open any more databases", at which point I have to close access and
re open it.
Query Description: Basically if the svc departments section is 1 and the
diagnostic test run is one of the codes in the test codes table who is in
group 10 put a 1 in the field, otherwise, put a zero. Then provide the sum.
The NZ function is there to ensure that there is a 0 put in the field if the
sum turn out to be 0. This one is for a specific week.
**Please note the test codes table is all the test that can be run for a
specific vehicle and are grouped accordingly eg 5 = Celecia, 3 = Civic etc...
** Please note that there is no specific car description in qry01_Base, or
anywhere for that matter.
Query code: SELECT nz(Sum(IIf([t10-section]=1 And [t10-Test] In (SELECT
T02_TestCodes.Name FROM T02_TestCodes WHERE
(((T02_TestCodes.Group)=10))),1,0)),0) AS MalibuRepairs2004
FROM qry01_Base
WHERE (((qry01_Base.Week) Between 1 And CInt([Please enter Week])) AND
((Year([FormattedRptdDate]))=2004))
WITH OWNERACCESS OPTION;
Now the reason that this is slow is that this query is slow is that it runs
the following code 60 times(Each in a different column in query design view)
in one query for each different car.
“nz(Sum(IIf([t10-section]=1 And [t10-Test] In (SELECT T02_TestCodes.Name
FROM T02_TestCodes WHERE (((T02_TestCodes.Group)=11))),1,0)),0) AS
CeleicaRepairs2004â€
In addition to that I have three more queries that do the exact same thing
but for a different year. Then I use one more query who references all the
other queries to group them together so that I can bind them to the report.
So I really have 240 fields.
Is there a better way to do this? Is there anyway to speed this up?
Any assistance would be great.
to do too much.
Problem: The problem is that it runs pretty slow. As well I can run the
report as many times as I like, but as soon as I run the report then go into
the rpt design view, then try and run the report again it gives me the error
"cannot open any more databases", at which point I have to close access and
re open it.
Query Description: Basically if the svc departments section is 1 and the
diagnostic test run is one of the codes in the test codes table who is in
group 10 put a 1 in the field, otherwise, put a zero. Then provide the sum.
The NZ function is there to ensure that there is a 0 put in the field if the
sum turn out to be 0. This one is for a specific week.
**Please note the test codes table is all the test that can be run for a
specific vehicle and are grouped accordingly eg 5 = Celecia, 3 = Civic etc...
** Please note that there is no specific car description in qry01_Base, or
anywhere for that matter.
Query code: SELECT nz(Sum(IIf([t10-section]=1 And [t10-Test] In (SELECT
T02_TestCodes.Name FROM T02_TestCodes WHERE
(((T02_TestCodes.Group)=10))),1,0)),0) AS MalibuRepairs2004
FROM qry01_Base
WHERE (((qry01_Base.Week) Between 1 And CInt([Please enter Week])) AND
((Year([FormattedRptdDate]))=2004))
WITH OWNERACCESS OPTION;
Now the reason that this is slow is that this query is slow is that it runs
the following code 60 times(Each in a different column in query design view)
in one query for each different car.
“nz(Sum(IIf([t10-section]=1 And [t10-Test] In (SELECT T02_TestCodes.Name
FROM T02_TestCodes WHERE (((T02_TestCodes.Group)=11))),1,0)),0) AS
CeleicaRepairs2004â€
In addition to that I have three more queries that do the exact same thing
but for a different year. Then I use one more query who references all the
other queries to group them together so that I can bind them to the report.
So I really have 240 fields.
Is there a better way to do this? Is there anyway to speed this up?
Any assistance would be great.