98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » access+course+training - Access queries
access+course+training - Access queries
Resolved · Low Priority · Version Standard
Lucy has attended:
Excel Intermediate course
Excel Advanced course
Access Introduction course
Access Intermediate course
Access queries
When I try to run and create a query to pull out all of my stockists who we want to sell to (from a Status--- 'want' table), it returns no results. The query doesn't say it has any problems though, what am I doing wrong?
thanks,
Lucy
RE: Access queries
Hi Lucy
Please will you click on VIEW and then SQL. If you send me that code ni a reply to this post, I will take a look for you.
Regards
Richard
RE: Access queries
SELECT Retailer.RetailerID, Retailer.Name, Retailer.Status
FROM Retailer INNER JOIN Branch ON Retailer.RetailerID = Branch.RetailerID
WHERE (((Retailer.Status)=[the Status]));
Hi Richard,
there it is, thank you-
LR
RE: Access queries
SELECT Retailer.RetailerID, Retailer.Name, Retailer.Status
FROM Retailer INNER JOIN Branch ON Retailer.RetailerID = Branch.RetailerID
WHERE (((Retailer.Status)=[the Status]));
Hi Richard,
there it is, thank you-
LR
RE: Access queries
Thanks Lucy
The SQL statement gives me a quick look at what you are trying to create. The basic statement looks fine, and what it looks like is that you are filtering using a variable [the status].
1 .
What I suggest is removing the criteria from the query, and seeing what results you get.
2.
If you get the records showing, then add just a simple critieria (ie. Yes - or whatever one of the values are).
3.
That should then filter the results yuo are looking for. If that works, then you know that the [the status] field is the issue.
If 1-3 return no results, then I suggest you look at the way you built the relationships between the tables. From what it looks like, it is just two tables, with a relationship on [RetailerID].
If this is the case, then check the type of relationship, by clicking on the line between the two tables. There should be 3 options, and depending on which one you choose, the results will differ. Generally Option 1 will give you the standard results, whereas 2 and 3 are more customised, and sometimes do not return any values.
Let me know if that helps.
Regards
Richard
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Copy a Previous Record's Values to a New RecordIf you often enter the same value in one field of a table, there are two methods to save re-typing the data. |