how to stop displaying records in a query based on a variable

PuddinPie

Registered User.
Local time
Yesterday, 23:44
Joined
Sep 15, 2010
Messages
149
I've been looking all over the place and can seem to find the answer to my question so I thought I would ask here.

I have a query that is based off of a two tables. I want to only display a certain number of results from the query which in one of the tables. I know how to do the top ten and such in the query properties but I need the amount to be based off a column in one of the tables, like it being based off of a variable.

Does anyone know how to accomplish this?
FYI the results are be displayed in a report.

Thank you.
 
Lets break down your question so someone can help. Please correct what is wrong and add more information:
1. There are 2 tables
2. The tables are Joined - Primary key in 1st table - Foreign key in 2nd table
3. The results of the query should only show:
- The result of a filter that is (or is not - please clarify) the primary key

For example:
A table with Orders and Order Details
The OrderID is linked to the column OrderID in the order details
So, one Order ID may have many Orders

The Order Details has a column called Categories (e.g. Books, Binders, Spices, and cats)
By placing a filter "Books" in the Category column - the result of all books regardless of the Order ID will be displayed.

The filter can be passed in from a variable - or from a value in a text box.
 
I actually figured it out. I just created another column with the variable I needed in it and then used it as the criteria at equal to or les then, but thank you for your time. It was an easy solution but i could not see it at the time and was over thinking it.
 

Users who are viewing this thread

Back
Top Bottom