[em]
Trying to create a subquery for a table in Access.
I am trying to pull out of a table all records where Sales amount is greater than 1000 and the discount rate is less than 5%. I have to calcuate the discount percentage in the table, and don't want to create another table with that field. How can I create this in a subquery.
I tried this code, but it didn't recognize the Discount_Percent field I created.
SELECT [Sales_2001-2010].* ,[Sales_2001-2010].[Discount_Amount]/[Sales_2001-2010].[Sales_Amount] AS Disount_Percent FROM [Sales_2001-2010] WHERE ((([sales_2001-2010].Sales_Amount)>1000))
The table has four fields Customer_Name Sales_Amount Discount_Amount Date
Thanks in Advance for the help.
[/em]
Software/Hardware used:
ASKED:
August 20, 2010 7:13 PM
UPDATED:
August 20, 2010 7:48 PM
I didn’t see any subquery in your code, and I don’t think you need one.
Where or when doesn’t it recognize the field ?
It might just be a typo, but in the query the alias for the discount calculation is Disount_Percent (not Discount_Percent)