My query has a parent and child tables. When I run the query, every time it asks me to enter parameters for some calculated fields.
Please notice that, in the query design, parent table is a connected through Left Jion with child table
My query has a parent and child tables. When I run the query, every time it asks me to enter parameters for some calculated fields.
Please notice that, in the query design, parent table is a connected through Left Jion with child table
a query will ask you for param usu because the query cant find the field:
1. you misspelled a field
2. you used a path to reference a field on a form ,but the path is incorrect. (use the builder to get the path names correct)
usu: forms!myform!cboBox
or forms!myForm!subform!form!textBox
Thank you, but I have already checked for misspelled fields. In fact I am trying to create a calculate field based on other calculated fields in the query and query does show the valid results too, but before displaying the results, it asks for parameters which I think it should not
Post the SQL.
Orders Query Requesting Parameters, why?
This is my SQL query, please check and reply
SELECT DISTINCT Orders.OrderID, Orders.CustomerID, Orders.VehicleID, Orders.DispatchDate, Orders.FixedWeight, Orders.RealWeight, [FixedWeight]-[RealWeight] AS ExtraWeight, Orders.NetFrt, Orders.Brokerage, Sum(OrderDetails.ExpAmount) AS Expenses, Sum(OrderDetails.RcvdFrt) AS TotalRcvdFrt, [NetFrt]+[Expenses] AS Receivable, [Brokerage]+[TotalRcvdFrt] AS Receivings, [Receivable]-[Receivings] AS OrderBalance
FROM Orders LEFT JOIN OrderDetails ON Orders.OrderID = OrderDetails.OrderID
GROUP BY Orders.OrderID, Orders.CustomerID, Orders.VehicleID, Orders.DispatchDate, Orders.FixedWeight, Orders.RealWeight, [FixedWeight]-[RealWeight], Orders.NetFrt, Orders.Brokerage, [NetFrt]+[Expenses], [Brokerage]+[TotalRcvdFrt], [Receivable]-[Receivings]
HAVING (((Orders.CustomerID)=1));
Check all the fields in square brackets to make sure that they exist on a table, e.g. change [Expenses] to use fields from the table, as well as the other calculated fields.
some things to try:
- wrap the calculations ([FixedWeight]-[RealWeight])
- use the complete reference (if the fields exist in both tables, it's certainly ambiguous) Orders.[FixedWeight]-Orders.[RealWeight]
- don't repeat the calculation in an ORDER BY clause: not "...Orders.RealWeight, [FixedWeight]-[RealWeight]" but ..."Orders.RealWeight, ExtraWeight..."
- create a select query that's based on the TOTALS query (where you do the calculations) or the other way around.
If none of that helps, post which fields are causing prompts so we can zero in.
Last edited by Micron; 03-13-2017 at 10:34 AM. Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
I deleted all resulting calculated field names after GROUP BY clause in SQL view, and it worked, no more parameter requests