RE: Null or No Null values in a parameter query
- From: tim <tim@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 Aug 2008 11:17:06 -0700
Karl,
Your (good) suggestion generated more questions - you may be sorry!
In design view, I can see that a field called 1 was added to my query with a
criteria evaluating the logical condition of whether my user-defined value is
null or not, then a value of 1 or 0 assigned depending on the condition. What
is this and how does it work? Can you explain a little more?
"KARL DEWEY" wrote:
.difference?in your example are capitalized and some are not - does this make a
No.
(BLDG.BLDG) Between [Enter start] And [Enter end] -- You would change BLDG
with your 'Due Dates' field and in this case input a range of dates for start
and end.
You need it a second time - first for nulls and second for no nulls.
Look at it in design view.
--
KARL DEWEY
Build a little - Test a little
"tim" wrote:
Thx very much Karl. I have programmed this and it works. I have a couple of
questions.
First, some of the "or" and "and" statements in your example are capitalized
and some are not - does this make a difference? Were you trying to emphasize
something? Seems like SQL made them all start with an uppercase, followed by
lower case letters.
Second, I don't quite follow the logic of what we are asking in the Where
statement that you wrote - we have:
(BLDG.BLDG) Between [Enter start] And [Enter end]
in the first part of the OR clause and then again as a second separate
statement in the second part of the OR clause. Why do we need it again as a
second statement - it seems like we already asked for it in the first part?
"KARL DEWEY" wrote:
Substitute your table and field names ---
SELECT BLDG.BLDG, 1 AS X
FROM BLDG
WHERE (((BLDG.BLDG) Between [Enter start] And [Enter end] Or (BLDG.BLDG) Is
Null) AND ((1)=IIf([Press ENTER for nulls, 'N" not nulls] Is Null,1,0))) OR
(((BLDG.BLDG) Between [Enter start] And [Enter end]));
--
KARL DEWEY
Build a little - Test a little
"tim" wrote:
I have a database of projects with fields that include Date_assigned and
Date_due. Not every project has a Date_due value now, some are null. I have
parameter query to view projects due by a user-defined period of dates, where
I prompt the user for the date criteria (meaning the period of interest).
Right now, I have the query criteria also include projects with Null values
(no Due Dates). Is it possible to make this a user-defined criteria too and
allow the user to include or exclude projects with no Due Date? If so, how
would I do this - would it be in the criteria as well?
- Follow-Ups:
- RE: Null or No Null values in a parameter query
- From: KARL DEWEY
- RE: Null or No Null values in a parameter query
- References:
- Null or No Null values in a parameter query
- From: tim
- RE: Null or No Null values in a parameter query
- From: KARL DEWEY
- RE: Null or No Null values in a parameter query
- From: tim
- RE: Null or No Null values in a parameter query
- From: KARL DEWEY
- Null or No Null values in a parameter query
- Prev by Date: Re: How do I show individual records
- Next by Date: Create a record on current mont
- Previous by thread: RE: Null or No Null values in a parameter query
- Next by thread: RE: Null or No Null values in a parameter query
- Index(es):
Relevant Pages
|