Hi guys i'm running a query which isn't too complicated but is taking a lot longer than I would expect to run, its suming the value of sales orders (there are over 200,000 in the db) invoiced in the current month
I'm not sure if i were to order the where clause of my query differently it would increase the performance
any advice on how I could increase the speed of this would be greatly appreciated , its taking 15 seconds to complete per employee , I want to produce a webpage with 15 employees monthly sales on and thats taking mins to complete.
many thanks
Andy
I'm not sure if i were to order the where clause of my query differently it would increase the performance
Code:
Select Sum(totlineamt) MonthlyTotal , Sum(totcost) TotalCost, Sum(vendrebamt) Rebate From pub.oeeh
where cono = 1 AND
invoicedt >= TO_Date('" & month(date) & "/01/" & year(date) & "') AND invoicedt <= TO_Date('" & month(date) & "/" & day(date) & "/" & year(date) & "')
AND slsrepin ='" & rsemployee("employee_sales_initials") & "'
AND UCASE (transtype) <>'RM'
any advice on how I could increase the speed of this would be greatly appreciated , its taking 15 seconds to complete per employee , I want to produce a webpage with 15 employees monthly sales on and thats taking mins to complete.
many thanks
Andy