C
Chaplain Doug
Access 2002. This is a repost with some updates. Once
you are on the third of fourth page of the newgroup you
are history. Anyhow, here goes.
I have a query that takes a long time to complete, namely
41 seconds. This same query when no criteria is specified
is instantaneous. The two colimns that cause the delay:
Inactive: DateDiff("d",Date(),Nz(DMax("[GDate]","[Grades
Query]","[StudentID]="+Str(Nz
([Students.StudentID],0))),"1/1/1990"))<-60
Grad: Nz(DLookUp("[GDate]","[Grades Query]","[StudentID]
="+Str(Nz([Students.StudentID],0))+" AND ([LessonTitle]
Like '*Diploma*')"),"#1/1/1990#")>#1/1/1990#
Please note that most of the stuff in these expressions
were done in a function. I moved the code from functions
to the actual query. This saved me 20 seconds. When I
set the criteria for these columns to False (or anything
else) the query takes 41 seconds to complete. Without
criteria it is instantly done. By the way, there are
2,650 records to be processed by this query. PLEASE
HELP! Thanks.
you are on the third of fourth page of the newgroup you
are history. Anyhow, here goes.
I have a query that takes a long time to complete, namely
41 seconds. This same query when no criteria is specified
is instantaneous. The two colimns that cause the delay:
Inactive: DateDiff("d",Date(),Nz(DMax("[GDate]","[Grades
Query]","[StudentID]="+Str(Nz
([Students.StudentID],0))),"1/1/1990"))<-60
Grad: Nz(DLookUp("[GDate]","[Grades Query]","[StudentID]
="+Str(Nz([Students.StudentID],0))+" AND ([LessonTitle]
Like '*Diploma*')"),"#1/1/1990#")>#1/1/1990#
Please note that most of the stuff in these expressions
were done in a function. I moved the code from functions
to the actual query. This saved me 20 seconds. When I
set the criteria for these columns to False (or anything
else) the query takes 41 seconds to complete. Without
criteria it is instantly done. By the way, there are
2,650 records to be processed by this query. PLEASE
HELP! Thanks.