A long shot I know but a colleague has left, leaving behind a couple of access databases that query each other and a sql database, unfortunately one of the databases querys now takes a long time to run to the point that the excel report calling the query timeouts. is it easy for any body to see what might cause it to take so long to run or how i could possible speed it up the SQL for the query is attached below

SELECT [Machine Rates].Group, [SFDC time transactions log].Machine, Calendar.FFPDATE_0 AS [Date], [SFDC time transactions log].TranTime, [SFDC time transactions log].Shift, [SFDC time transactions log].Phase, [SFDC time transactions log].EmpNo, [SFDC time transactions log].WON, [SFDC time transactions log].Operation, [SFDC time transactions log].Qty_Comp, [SFDC time transactions log].Qty_Rej, [SFDC time transactions log].Setup, [SFDC time transactions log].[Act Run], " " AS Downtime, "Actual Running" AS Type, Calendar.FFPPERIOD_0 AS Period, Calendar.FFPWEEK_0 AS Week, [Machine Rates].[Labour Rate], Calendar.FFPYEAR_0 AS [Year], [Machine Rates].[Overhead Rate], [Material Type Summary].MarlType
FROM ((([SFDC time transactions log] INNER JOIN Calendar ON [SFDC time transactions log].TranDate = Calendar.TXTDATE1_0) INNER JOIN [Machine Rates] ON [SFDC time transactions log].Machine = [Machine Rates].WSTSHO_0) INNER JOIN (FFP_MFGITM INNER JOIN FFP_ITMMASTER ON FFP_MFGITM.ITMREF_0 = FFP_ITMMASTER.ITMREF_0) ON [SFDC time transactions log].WON = FFP_MFGITM.MFGNUM_0) INNER JOIN [Material Type Summary] ON FFP_ITMMASTER.TSICOD_1 = [Material Type Summary].Code
WHERE FFP_MFGITM.MFGNUM_0 AND FFP_MFGITM.MFGNUM_0<>"WOF0072894"
GROUP BY [Machine Rates].Group, [SFDC time transactions log].Machine, Calendar.FFPDATE_0, [SFDC time transactions log].TranTime, [SFDC time transactions log].Shift, [SFDC time transactions log].Phase, [SFDC time transactions log].EmpNo, [SFDC time transactions log].WON, [SFDC time transactions log].Operation, [SFDC time transactions log].Qty_Comp, [SFDC time transactions log].Qty_Rej, [SFDC time transactions log].Setup, [SFDC time transactions log].[Act Run], " ", "Actual Running", Calendar.FFPPERIOD_0, Calendar.FFPWEEK_0, [Machine Rates].[Labour Rate], Calendar.FFPYEAR_0, [Machine Rates].[Overhead Rate], [Material Type Summary].MarlType
ORDER BY [Machine Rates].Group, [SFDC time transactions log].Machine, Calendar.FFPDATE_0 DESC , [SFDC time transactions log].TranTime DESC;

Is this in some code? If so, can you change the timeout? Example:

'For Timeout'
        Application.ODBCTimeout = 9999
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.