query when dont use parameter for blank items

  • Thread starter Thread starter toby
  • Start date Start date
T

toby

hi all,
i've set up a query for choosing certain items with several criteriam
for example
FROM IEd_bk
WHERE ((([IEd_bk].[ppc])=[Enter ¥Xª©¦a]) And (([IEd_bk].[distr])=[Enter
Distributor]) And (([IEd_bk].[status])=[Enter status]));

the question is that wht should i do if i want to filter out the items that
blank in column "status"?!?!
as i 've try to just pass the dialog when it asks me for entering status,
but it comes no records show(but actually i do hv records with the
criteria).

can any body me to do it?!?!
thanks in advance.

rgds
Toby
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Not quite sure what you want. I've deciphered that you want to get any
records that have whatever the user enters in the [Enter status] prompt
and also has NULLs in the Status column. Correct? If so,

WHERE IEd_bk.ppc=[Enter ¥Xª©¦a]
AND IEd_bk.distr=[Enter Distributor]
AND (IEd_bk.status=[Enter status] OR IEd_bk.Status IS Null)

Use 2 expressions inclosed in a parentheses - the last AND line.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQX/lsoechKqOuFEgEQKgrgCdHo1+hlAqtG2pI4Cx+Vj/bf8fploAnRv1
Wbc0LbFxIHtgL5nNyOLoayAt
=i1zm
-----END PGP SIGNATURE-----
 
You could try using a calculated column for Status. Assuming the column is a
text column, you could use something like the following.

SELECT ...

FROM IEd_bk
WHERE [IEd_bk].[ppc]=[Enter ¥Xª©|a]
And [IEd_bk].[distr]=[Enter Distributor]
And Nz([IEd_bk].[status],"")=NZ([Enter status],"")

This WILL be slow as the SQL cannot take advantage of any index that exists on
the status field.
 
Back
Top