A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Optimizing my query using MAX



 
 
Thread Tools Display Modes
  #1  
Old July 15th, 2008, 06:25 PM posted to microsoft.public.access.queries
lina
external usenet poster
 
Posts: 66
Default Optimizing my query using MAX

I need some one to help me Optimize my query using MAX or DMax or Top 1,
however.

I have a large result query that sumirized the sales (for each region) from
past months. Then I need to find the max data from last months for each year.
I have used Dmax, I have used a subquery in the select section, I have used a
Top 1 in the having section... all of them give me the same result which is
the correct one. My problem is the speed. It takes too long to be executed.

Is there a way I can work this out more efficiently?

Thanks a lot in advanced, Lina
  #2  
Old July 16th, 2008, 12:51 AM posted to microsoft.public.access.queries
MGFoster
external usenet poster
 
Posts: 653
Default Optimizing my query using MAX

Lina wrote:
I need some one to help me Optimize my query using MAX or DMax or Top 1,
however.

I have a large result query that sumirized the sales (for each region) from
past months. Then I need to find the max data from last months for each year.
I have used Dmax, I have used a subquery in the select section, I have used a
Top 1 in the having section... all of them give me the same result which is
the correct one. My problem is the speed. It takes too long to be executed.

Is there a way I can work this out more efficiently?

Thanks a lot in advanced, Lina


Using the MAX() function requires the query engine to create a new
temporary table (or file) of the sorted data and then go thru that data
searching for the data that matches the MAX criteria. Sometimes you can
increase the speed of queries on summary queries by temporarily storing
the summarized data in a temp. table, then run the MAX query against the
temp. table. YMMV.

You could also post your query (queries) and see if someone can come up
with a better solution(s).
--
MGFoster:::mgf00
Oakland, CA (USA)
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.