T
Tiegris78
I am trying to create a report that will compare the length of time a task
takes to be completed to the length of time it took to be completed the year
before. I have been able to create a query that will generate the data for
current records and then another query that prompts for a specific time range
for the criteria. I have not been able to create another query that can take
that date range from the 2nd and pull the records from the 1st from the year
before the specified date range of the 2nd. I know there is a way I can do
this, but I'm stuck on how.
SQL Statement for Query1
SELECT [Insurer Contacts].[Store #], [Insurer Contacts].[Claim #], [Claim
Dates].[Measure Date], [Measure Date]-[Start Date] AS Expr10, [Claim
Dates].[ITEL Rec], [ITEL Rec]-[Measure Date] AS Expr2, [Claim
Dates].[Estimate Downloaded], [Estimate Downloaded]-[Measure Date] AS Expr3,
[Claim Dates].[Order Date], [Claim Dates].[Estimate Approval], [Order
Date]-[Estimate Approval] AS Expr4, [Claim Dates].[Install Date], [Install
Date]-[Order Date] AS Expr5, [Claim Dates].[ATP Sent], [ATP Sent]-[Install
Date] AS Expr6, [Claim Dates].[Job Costed], [Job Costed]-[Install Date] AS
Expr7, [Claim Dates].[Pymnt Applied], [Pymnt Applied]-[Job Costed] AS Expr9,
[Job Costed]-[Start Date] AS Expr8, [Insurance Status].[Insurance $],
[Insurance Status].[Written Sales], [Sales $ Query].Expr1, [Claim
Dates].[Start Date]
FROM (([Insurer Contacts] INNER JOIN [Sales $ Query] ON [Insurer
Contacts].[Claim #] = [Sales $ Query].[Claim #]) LEFT JOIN [Insurance Status]
ON [Insurer Contacts].[Claim #] = [Insurance Status].[Claim #]) LEFT JOIN
[Claim Dates] ON [Insurer Contacts].[Claim #] = [Claim Dates].[Claim #];
SQL Statement for Query2
SELECT [Insurer Contacts].[Store #], [Insurer Contacts].[Claim #], [Claim
Dates].[Measure Date], [Claim Dates]![Measure Date]-[Claim Dates]![Start
Date] AS Expr10, [Claim Dates].[ITEL Rec], [Claim Dates]![ITEL Rec]-[Claim
Dates]![Measure Date] AS Expr2, [Claim Dates].[Estimate Downloaded], [Claim
Dates]![Estimate Downloaded]-[Claim Dates]![Measure Date] AS Expr3, [Claim
Dates].[Order Date], [Claim Dates].[Estimate Approval], [Claim Dates]![Order
Date]-[Claim Dates]![Estimate Approval] AS Expr4, [Claim Dates].[Install
Date], [Claim Dates]![Install Date]-[Claim Dates]![Order Date] AS Expr5,
[Claim Dates].[ATP Sent], [Claim Dates]![ATP Sent]-[Claim Dates]![Install
Date] AS Expr6, [Claim Dates].[Job Costed], [Claim Dates]![Job Costed]-[Claim
Dates]![Install Date] AS Expr7, [Claim Dates].[Pymnt Applied], [Claim
Dates]![Pymnt Applied]-[Claim Dates]![Job Costed] AS Expr9, [Claim
Dates]![Job Costed]-[Claim Dates]![Start Date] AS Expr8, [Insurance
Status].[Insurance $], [Insurance Status].[Written Sales], [Sales $
Query].Expr1, [Claim Dates].[Start Date]
FROM (([Insurer Contacts] INNER JOIN [Sales $ Query] ON [Insurer
Contacts].[Claim #] = [Sales $ Query].[Claim #]) LEFT JOIN [Insurance Status]
ON [Insurer Contacts].[Claim #] = [Insurance Status].[Claim #]) LEFT JOIN
[Claim Dates] ON [Insurer Contacts].[Claim #] = [Claim Dates].[Claim #]
WHERE ((([Claim Dates].[Start Date]) Between [Type the beginning date:] And
[Type the ending date:]));
takes to be completed to the length of time it took to be completed the year
before. I have been able to create a query that will generate the data for
current records and then another query that prompts for a specific time range
for the criteria. I have not been able to create another query that can take
that date range from the 2nd and pull the records from the 1st from the year
before the specified date range of the 2nd. I know there is a way I can do
this, but I'm stuck on how.
SQL Statement for Query1
SELECT [Insurer Contacts].[Store #], [Insurer Contacts].[Claim #], [Claim
Dates].[Measure Date], [Measure Date]-[Start Date] AS Expr10, [Claim
Dates].[ITEL Rec], [ITEL Rec]-[Measure Date] AS Expr2, [Claim
Dates].[Estimate Downloaded], [Estimate Downloaded]-[Measure Date] AS Expr3,
[Claim Dates].[Order Date], [Claim Dates].[Estimate Approval], [Order
Date]-[Estimate Approval] AS Expr4, [Claim Dates].[Install Date], [Install
Date]-[Order Date] AS Expr5, [Claim Dates].[ATP Sent], [ATP Sent]-[Install
Date] AS Expr6, [Claim Dates].[Job Costed], [Job Costed]-[Install Date] AS
Expr7, [Claim Dates].[Pymnt Applied], [Pymnt Applied]-[Job Costed] AS Expr9,
[Job Costed]-[Start Date] AS Expr8, [Insurance Status].[Insurance $],
[Insurance Status].[Written Sales], [Sales $ Query].Expr1, [Claim
Dates].[Start Date]
FROM (([Insurer Contacts] INNER JOIN [Sales $ Query] ON [Insurer
Contacts].[Claim #] = [Sales $ Query].[Claim #]) LEFT JOIN [Insurance Status]
ON [Insurer Contacts].[Claim #] = [Insurance Status].[Claim #]) LEFT JOIN
[Claim Dates] ON [Insurer Contacts].[Claim #] = [Claim Dates].[Claim #];
SQL Statement for Query2
SELECT [Insurer Contacts].[Store #], [Insurer Contacts].[Claim #], [Claim
Dates].[Measure Date], [Claim Dates]![Measure Date]-[Claim Dates]![Start
Date] AS Expr10, [Claim Dates].[ITEL Rec], [Claim Dates]![ITEL Rec]-[Claim
Dates]![Measure Date] AS Expr2, [Claim Dates].[Estimate Downloaded], [Claim
Dates]![Estimate Downloaded]-[Claim Dates]![Measure Date] AS Expr3, [Claim
Dates].[Order Date], [Claim Dates].[Estimate Approval], [Claim Dates]![Order
Date]-[Claim Dates]![Estimate Approval] AS Expr4, [Claim Dates].[Install
Date], [Claim Dates]![Install Date]-[Claim Dates]![Order Date] AS Expr5,
[Claim Dates].[ATP Sent], [Claim Dates]![ATP Sent]-[Claim Dates]![Install
Date] AS Expr6, [Claim Dates].[Job Costed], [Claim Dates]![Job Costed]-[Claim
Dates]![Install Date] AS Expr7, [Claim Dates].[Pymnt Applied], [Claim
Dates]![Pymnt Applied]-[Claim Dates]![Job Costed] AS Expr9, [Claim
Dates]![Job Costed]-[Claim Dates]![Start Date] AS Expr8, [Insurance
Status].[Insurance $], [Insurance Status].[Written Sales], [Sales $
Query].Expr1, [Claim Dates].[Start Date]
FROM (([Insurer Contacts] INNER JOIN [Sales $ Query] ON [Insurer
Contacts].[Claim #] = [Sales $ Query].[Claim #]) LEFT JOIN [Insurance Status]
ON [Insurer Contacts].[Claim #] = [Insurance Status].[Claim #]) LEFT JOIN
[Claim Dates] ON [Insurer Contacts].[Claim #] = [Claim Dates].[Claim #]
WHERE ((([Claim Dates].[Start Date]) Between [Type the beginning date:] And
[Type the ending date:]));