Please excuse my tzping errors when using a foreign kezboard the switches the z and y kezs.
Duane
Sent: Wednesday, November 16, 2016 12:16 PM
To: MS_Access_Professionals@yahoogroups.com
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 '*'...
Regards,
Duane
Sent: Wednesday, November 16, 2016 11:37 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Will Like '*' return records if the value is null?
Hello Pros,
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:
SELECT qS.*
FROM qS
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?
Doyce
Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar