Results 1 to 4 of 4
  1. #1
    FMJO is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    3

    Improve query speed

    Hello All,



    This is my first post in this forum!

    I run a query using a form and I extract some parameters from the form. If I run the query without extracting the parameters from the form, it runs way more faster than when I do it through the form.

    How can I improve the speed of the query when it runs extracting parameters from the from???

    Thanks for your help!

    Orlando

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Please show us some code.

  3. #3
    FMJO is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    3
    Here's the SQL statement:

    Code:
    SELECT a.GENERATION, b.failcode, b.failcode2, Count(*) AS Amount, Count(*)/(SELECT Count(*) FROM LTO_FR_LTO_PRODUCT_DESCRIPTIONS AS a INNER JOIN LTO_FR_TRIAGEA AS b ON a.PN=b.PN WHERE (((b.DT)>=[Forms]![QP]![txtTaFromDate] And (b.DT)<DateSerial(Year([Forms]![QP]![txtTaToDate]),Month([Forms]![QP]![txtTaToDate]),Day([Forms]![QP]![txtTaToDate]))+1) And (a.generation)=[Forms]![QP]![cmbTaGen])AND ((a.FORM_FACTOR)=IIf([Forms]![QP]![Height]=1,"HH",IIf([Forms]![QP]![Height]=2,"FH",[a.FORM_FACTOR])))) AS Percentage, a.FORM_FACTOR
    FROM LTO_FR_LTO_PRODUCT_DESCRIPTIONS AS a INNER JOIN LTO_FR_TRIAGEA AS b ON a.PN=b.PN
    WHERE (((b.DT)>=Forms!QP!txtTaFromDate And (b.DT)<DateSerial(Year(Forms!QP!txtTaToDate),Month(Forms!QP!txtTaToDate),Day(Forms!QP!txtTaToDate))+1) And ((a.generation)=Forms!QP!cmbTaGen) And ((a.FORM_FACTOR)=IIf(Forms!QP!Height=1,"HH",IIf(Forms!QP!Height=2,"FH",[a.FORM_FACTOR]))))
    GROUP BY a.GENERATION, b.failcode, b.failcode2, a.FORM_FACTOR
    ORDER BY Count(*) DESC , a.FORM_FACTOR DESC;
    As you can see I extract some values from the form QP. However, If I define the values explicitly (w/o using the form) the query runs faster.

    Orlando

  4. #4
    FMJO is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    3
    Beside the issue with the speed, feel free to make any suggestion to improve the SQL statement.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 11-15-2010, 09:21 PM
  2. Need for Speed
    By OceanaPolynom in forum Programming
    Replies: 2
    Last Post: 07-13-2010, 08:30 PM
  3. Increase search speed
    By kjuelfs in forum Queries
    Replies: 3
    Last Post: 07-12-2010, 05:11 AM
  4. Query speed issues
    By thart21 in forum Queries
    Replies: 2
    Last Post: 04-07-2010, 05:16 PM
  5. Speed issue
    By hey23 in forum Queries
    Replies: 1
    Last Post: 06-24-2009, 09:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums