Subquery in Microsoft Access

5 pts.
Tags:
Access
Access query
Access Tables
Subquery
[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]
ASKED: August 20, 2010  7:13 PM
UPDATED: August 20, 2010  7:48 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    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)
    65,110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following