Hi John,
Actually I want to pull up just the records that meet the criteria and
ignore null values. What my SQL code did was pull up nothing if one of the
fields was blank - I want it to ignore a field if it is blank.
Thanks
"John W. Vinson" wrote:
> On Wed, 7 Nov 2007 14:08:00 -0800, Bonnie <(E-Mail Removed)>
> wrote:
>
> >The problem is, if any of these items are null - the query shows no records.
> > How can I conditionally check and ignore null values?
>
> Just do so:
>
> SELECT PARTS.UNITPRICE, PARTS.ITEMDESC, PARTS.WIDTH, PARTS.LENGTH,
> PARTS.LHEIGHT
> FROM PARTS
> WHERE
> (((PARTS.ITEMDESC)=[forms]![form1]![descrip] OR [forms]![form1]![descrip] IS
> NULL)
> And
> ((PARTS.WIDTH)=[forms]![form1]![text2] OR [forms]![form1]![text2] IS NULL)
> And
> ((PARTS.LENGTH)=[forms]![form1]![text4] OR [forms]![form1]![text4] IS NULL)
> And
> ((PARTS.LHEIGHT)=[forms]![form1]![text6] OR [forms]![form1]![text6] IS NULL));
>
> Try to avoid going back to the query grid after pasting the SQL - it will add
> all four forms references as calculated fields and make an absolute hash of
> the display. Just save the SQL. Also note that ! is a better delimiter for
> forms references, and that the square brackets are recommended.
>
> Note also that running the query without filling in any of the textboxes will
> return all records. This may be what you want...
>
> John W. Vinson [MVP]
>
>
>
|