[Solved] Query asking for parameters
I have a query that pulls information from two tables. Some of the fields that are being queried share the same name in the tables, [Reimbursed_Amount] and [Cancel_Fee] specifically. In Design View I have specified that I only want the query to pull these fields from the Event Information table. An error occurs when I try to run it, saying that I need to define which table the field is from in the SQL code.
But then after I added clarification in the SQL, when I run the query it now prompts for a parameter for each of these fields. Why is this happening? I leave it blank, so a parameter has no impact on the query. How can I stop this?
Here's the SQL, after I added the table clarification:
I have a query that pulls information from two tables. Some of the fields that are being queried share the same name in the tables, [Reimbursed_Amount] and [Cancel_Fee] specifically. In Design View I have specified that I only want the query to pull these fields from the Event Information table. An error occurs when I try to run it, saying that I need to define which table the field is from in the SQL code.
But then after I added clarification in the SQL, when I run the query it now prompts for a parameter for each of these fields. Why is this happening? I leave it blank, so a parameter has no impact on the query. How can I stop this?
Here's the SQL, after I added the table clarification:
Code:
SELECT (Sum(nz([Program_Cost])+nz([Millage_Fee])+nz([Auditorium_Cost])+nz([Cancel_Fee].[Event Information])-nz([Reimbursed_Amount].[Event Information]))) AS Total_Cost, [Shared Billing Information].Paid, [Shared Billing Information].Shared_Billing_ID, [Event Information].Shared_Billing_ID
FROM [Shared Billing Information] RIGHT JOIN [Event Information] ON [Shared Billing Information].Shared_Billing_ID = [Event Information].Shared_Billing_ID
GROUP BY [Shared Billing Information].Paid, [Shared Billing Information].Shared_Billing_ID, [Event Information].Shared_Billing_ID, [Event Information].Event_ID, [Event Information].Program_Code, [Event Information].Date_of_Event, [Event Information].Cancel_Fee, [Event Information].Reimbursed_Amount, [Event Information].Sample_Lock, [Event Information].Paid, [Event Information].Incomplete_Booking, [Event Information].Auditorium_Cost, [Event Information].Millage_Fee, [Event Information].Program_Cost, [Event Information].Multiple_On_Billing
HAVING ((([Shared Billing Information].Paid)="-1") AND (([Event Information].Program_Code)="ZM") AND (([Event Information].Date_of_Event) Between [Forms]![Program Summary Reports]![StartDateTxt] And [Forms]![Program Summary Reports]![EndDateTxt]) AND (([Event Information].Sample_Lock) Is Null Or ([Event Information].Sample_Lock)="0") AND (([Event Information].Incomplete_Booking) Is Null Or ([Event Information].Incomplete_Booking)="0") AND (([Event Information].Multiple_On_Billing)="-1"));
Last edited: