Report Running extremely slow

mapat

Registered User.
Local time
Today, 05:11
Joined
Feb 2, 2007
Messages
176
Hello,

Why is it that when I run the report from a front end, when my back end was an ACCESS file it would take 2 seconds to open, and now that I have a SQL Server 2008 back end (with same tables) it takes 5 minutes to open. The strange part is that the query that drives the report runs in 2 seconds as well. I already checked and made sure that all the join fields are indexes. Can someone give me a hint on this?

Thanks
 
What else is on the report? Are there calculations, Domain Aggregate functions, etc.?
 
What version of access are you running?
How have you linked to the SQL 2008 tables?
What is the connection string for the table?
Are you mixing local tables with linked tables?
 
What else is on the report? Are there calculations, Domain Aggregate functions, etc.?


Yes. This is the query that runs the report:

SELECT Format(Avg(([SumOfTuition]-[SumOfAid]-[SumOfAmount])),'$#,#00') AS AvgFamilyContribution, Format(Avg([CountOfStudent ID]),'Fixed') AS AvgChildren, Format(Avg([Income]),'$0,000') AS AvgIncome, Format(([AvgFamilyContribution]/[AvgChildren]),'$#,#00') AS AvgChildContribution, Sum([qSum of Amounts by Family].[CountOfStudent ID]) AS Students, [qHomeschool Avg Last Year].AvgOfSumOfAmountPaid AS HomeAvg, Format(Sum([SumOfAmount]),'$0,000') AS [Total Money], Format(([Total Money]/([Students]-[HomeKids])),'$#,#00') AS AvgScholarship, tDatabaseLookup.RegionName, [qSum of Amounts by Family].GuardYear, tCustomization.ElemCap, tCustomization.SecCap, [qAverages from Last Year].AvgOfTuition, [qAverages from Last Year].AvgOfAmount, [qAverages from Last Year].AvgOfIncome, Sum([qSum of Amounts by Family].HSTuition) AS HSTuitionTotal, Sum([qSum of Amounts by Family].ElemTuition) AS ElemTuitionTotal, Sum([qSum of Amounts by Family].HSAmount) AS TotalHS, Sum([qSum of Amounts by Family].ElemAmount) AS TotalElem, Sum([qSum of Amounts by Family].HSKids) AS HSKidsTotal, Sum([qSum of Amounts by Family].ElemKids) AS ElemKidsTotal, Sum([HomeHSKids]+[HomeESKids]) AS HomeKids, Sum([qSum of Amounts by Family].Siblings) AS SumOfSiblings, Sum([qSum of Amounts by Family].Returning) AS SumOfReturning, Sum([qSum of Amounts by Family].AtCap) AS SumOfAtCap, Format(Sum([SumOfTuition])/([Students]-[HomeKids]),'$#,#00') AS AverageTuition, 'All Funding Types' AS Funding, 12 AS UpperGrade, 0 AS LowerGrade
FROM [qSum of Amounts by Family], [qAverages from Last Year], [qHomeschool Avg Last Year], tCustomization INNER JOIN tDatabaseLookup ON tCustomization.DatabaseID = tDatabaseLookup.LetterCode
GROUP BY [qHomeschool Avg Last Year].AvgOfSumOfAmountPaid, tDatabaseLookup.RegionName, [qSum of Amounts by Family].GuardYear, tCustomization.ElemCap, tCustomization.SecCap, [qAverages from Last Year].AvgOfTuition, [qAverages from Last Year].AvgOfAmount, [qAverages from Last Year].AvgOfIncome;
 
I actually meant calculations ON the report (not in the query). You already said the query runs fine by itself, but do you have any controls where you are doing something with the control sources like

=Sum([FieldHere])

or =[Field1]/[Field2]

or
= DLookup("zzz","YYY","[SSS]=" & Me!FieldNameHere)

etc.
 
I actually meant calculations ON the report (not in the query). You already said the query runs fine by itself, but do you have any controls where you are doing something with the control sources like

=Sum([FieldHere])

or =[Field1]/[Field2]

or
= DLookup("zzz","YYY","[SSS]=" & Me!FieldNameHere)

etc.

Yes, some fields use the IIF function, others are calculated based on other fields (e.g: field1/field2 like you mentioned).
I am using ACCESS 2007
 
Yes, some fields use the IIF function, others are calculated based on other fields (e.g: field1/field2 like you mentioned).
I am using ACCESS 2007

That would likely be the source of your slowdown.
 
Try turning your Query into a 'make table Query' and run the report off the local table to see what performance you get.
 
That would likely be the source of your slowdown.

But, why would it run OK with the ACCESS back-end then? I thought that migrating the tables to SQL Server was better than having them in ACCESS, or at least things would run at the same speed.

Thanks
 

Users who are viewing this thread

Back
Top Bottom