Hi,
Microsoft Access 2003 Front-End with SQL Server Backend
I have the following query that is run from a reports form. On the form is 2 fields for the StartDate and EndDate which opens a report.
This is was working for years and now has suddenly been stalling and causes an ODBC timeout.
I can run the query if i just put the following in the criteria Between #01/01/1998# And #16/03/2020# but when I use this query behind the form it just stalls or ODBC timeout
If put the following in the criteria on the query "Between [Forms]![Reports]![StartDate] And [Forms]![Reports]![EndDate] the query also stalls.
INSERT INTO [Collate TX Temp] ( CompanyID, Name, SumOfTX, TransTypeID, SumOfEuroTX )
SELECT Companies.CompanyID, Companies.Name, Sum((([Amount]*[VatRate]/100)+[Amount])) AS Gross, "13 Sales Invoice" AS [TX Type], Sum((([EuroAmount]*[VatRate]/100)+[EuroAmount])) AS EuroGross
FROM Jobs INNER JOIN ((Customers INNER JOIN (Companies INNER JOIN [Sales Invoices] ON Companies.CompanyID = [Sales Invoices].CompanyID) ON Customers.CustomerID = [Sales Invoices].CustomerID) INNER JOIN [Sales Invoice Details] ON [Sales Invoices].SalesInvoiceID = [Sales Invoice Details].SalesInvoiceID) ON Jobs.JobID = [Sales Invoice Details].JobID
WHERE ((([Sales Invoices].SalesInvoiceDate) Between [Forms]![Reports]![StartDate] And [Forms]![Reports]![EndDate]))
GROUP BY Companies.CompanyID, Companies.Name, [Sales Invoices].SalesInvoiceID, [Sales Invoice Details].VatRate
ORDER BY [Sales Invoices].SalesInvoiceID;
Any help would be greatly appreciated
Microsoft Access 2003 Front-End with SQL Server Backend
I have the following query that is run from a reports form. On the form is 2 fields for the StartDate and EndDate which opens a report.
This is was working for years and now has suddenly been stalling and causes an ODBC timeout.
I can run the query if i just put the following in the criteria Between #01/01/1998# And #16/03/2020# but when I use this query behind the form it just stalls or ODBC timeout
If put the following in the criteria on the query "Between [Forms]![Reports]![StartDate] And [Forms]![Reports]![EndDate] the query also stalls.
INSERT INTO [Collate TX Temp] ( CompanyID, Name, SumOfTX, TransTypeID, SumOfEuroTX )
SELECT Companies.CompanyID, Companies.Name, Sum((([Amount]*[VatRate]/100)+[Amount])) AS Gross, "13 Sales Invoice" AS [TX Type], Sum((([EuroAmount]*[VatRate]/100)+[EuroAmount])) AS EuroGross
FROM Jobs INNER JOIN ((Customers INNER JOIN (Companies INNER JOIN [Sales Invoices] ON Companies.CompanyID = [Sales Invoices].CompanyID) ON Customers.CustomerID = [Sales Invoices].CustomerID) INNER JOIN [Sales Invoice Details] ON [Sales Invoices].SalesInvoiceID = [Sales Invoice Details].SalesInvoiceID) ON Jobs.JobID = [Sales Invoice Details].JobID
WHERE ((([Sales Invoices].SalesInvoiceDate) Between [Forms]![Reports]![StartDate] And [Forms]![Reports]![EndDate]))
GROUP BY Companies.CompanyID, Companies.Name, [Sales Invoices].SalesInvoiceID, [Sales Invoice Details].VatRate
ORDER BY [Sales Invoices].SalesInvoiceID;
Any help would be greatly appreciated