From: Rubem on
Hi,

I have a query with the following fields: Date, part number, description,
problem description, etc...
I want to put 2 indepedent criteria in the same query. In another word, If I
want only the date range I would enter the date range or if I want just the
problem description of a particular part, I would enter the part number.

Any suggestion?

Thank you.

Rubem
From: Al Campagna on
Rubem,
First, don't name a field "Date" It's a reserved word in Access.
Try PurchaseDate, or BirthDate, etc... (I'll use XDate)

You could use parameters.
Against the XDate...
Between NZ([Start Date], #1/1/1940#) AND NZ([End Date], #1/1/2100#)
Against PartNo...
Like "*" & [Enter Part No] & "*"

When prompted for a parameter value...
If no [Start Date] and [End Date] are entered, all XDate values are
returned.
If no [Enter Part No] is entered, all PartNo values are returned.
If no parameters are entered, all records will be returned.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Rubem" <Rubem(a)discussions.microsoft.com> wrote in message
news:F0FF5540-5FFB-4E7D-8DCB-38A2DFD0EBCC(a)microsoft.com...
> Hi,
>
> I have a query with the following fields: Date, part number, description,
> problem description, etc...
> I want to put 2 indepedent criteria in the same query. In another word, If
> I
> want only the date range I would enter the date range or if I want just
> the
> problem description of a particular part, I would enter the part number.
>
> Any suggestion?
>
> Thank you.
>
> Rubem


From: Tom van Stiphout on
On Wed, 5 May 2010 05:30:01 -0700, Rubem
<Rubem(a)discussions.microsoft.com> wrote:

My suggestion is not to start a new thread, but continue the
discussion in the first one, where I answered your question.

-Tom.
Microsoft Access MVP


>Hi,
>
>I have a query with the following fields: Date, part number, description,
>problem description, etc...
>I want to put 2 indepedent criteria in the same query. In another word, If I
>want only the date range I would enter the date range or if I want just the
>problem description of a particular part, I would enter the part number.
>
>Any suggestion?
>
>Thank you.
>
>Rubem