Please excuse my tzping errors when using a foreign kezboard the switches the z and y kezs.
Sent: Wednesday, November 16, 2016 12:16 PM
Subject: Re: [MS_AccessPros] Will Like '*' return records if the value is null?
I agree with John. As zou start building your WHERE condition, you should ignore the columns/fields that aren't relevant.
However, you could use this type of syntax:
WHERE qS.MSDSID & '' Like '*'...
Sent: Wednesday, November 16, 2016 11:37 AM
Subject: [MS_AccessPros] Will Like '*' return records if the value is null?
I'm building a query on the fly through VBA and if appears that if the values for a field are null, the query won't return the record using criteria Like '*' for the field. Is that a correct? Here is the SQL of the query:
WHERE (((qS.MSDSID) Like '*') AND ((qS.ProductName) Like '*') AND ((qS.Category) Like '*') AND ((qS.MName) Like '*') AND ((qS.ChemTrekNo) Like '*') AND ((qS.PartNO) Like '*'));
In my table there are only 6 records and ChemTrekNo is null for all 6. Using Like '*' as criteria for ChemTrekNo no records are returned. What do I do if I want the records that contain nulls? Wrap it in Nz? What would the SQL look like?
Posted by: Duane Hookom <email@example.com>
|Reply via web post||•||Reply to sender||•||Reply to group||•||Start a New Topic||•||Messages in this topic (4)|