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