Re: multiple Criteria
From: Tom Ellison (tellison_at_jcdoyle.com)
Date: 03/31/04
- Next message: Dan: "Re: crosstab query does not recognize form reference"
- Previous message: Karen: "Counting"
- In reply to: Georgia: "multiple Criteria"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 31 Mar 2004 13:42:29 -0600
Dear Georgia:
When your query contains complex logic that includes multiple ANDs and
ORs, the Query Design Grid makes a mess of it. While it is possible
to work within the grid, you're going to be an expert logician to do
it.
I suggest you work out the SQL for your criteria. This allows you
parenthesized notation that will make the job easier for humans.
The WHERE part of your query can be entered as:
WHERE (UserID = [UserID:] OR [UserID:] IS NULL)
AND (Division = [Division:] OR [Division:] IS NULL)
AND (District = [District:] OR [District:] IS NULL)
When you have entered this, save it as another, temporary query name,
and see if it works. Then you can go to the grid and see what a mess
it is there. It will make you glad you leanred SQL!
Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
On Wed, 31 Mar 2004 11:26:09 -0800, "Georgia"
<anonymous@discussions.microsoft.com> wrote:
>Hi.
>These are the fields i have in the query
>
>Invoice #, Invoice Amount, User ID, Division, District
>
>Under User ID, under criteria, i have put --- like[UserID:], under or = like [UserID:] is null.
>So that when query is ran, it will prompt you to type in your User ID to pull only your record. Or if you leave it blank, it will pull every record.
>
>My question is how do I set this up under Division and District also?
>When I put under Division =[Division:] or is null and under District = [District:] or is null.., when I run the query, type in my user ID number and leave District and Division blank, it will not pull my user ID name with all district and division.
>
>I want to run a query where it will prompt to ask me those three criterias and pulls correct informations.
>
>For example:
>I type my name, i don't know the district , but i know the division. i want the query to pull my name, the division i type but all district since i did not specifiy which one.
>Please help!
>
>Thank you!
- Next message: Dan: "Re: crosstab query does not recognize form reference"
- Previous message: Karen: "Counting"
- In reply to: Georgia: "multiple Criteria"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|