Re: Recordset Filter property and NULL
From: Mark J. McGinty (mmcginty_at_spamfromyou.com)
Date: 02/23/05
- Next message: Stephen Howe: "Re: Returning Null value instead of contents of field"
- Previous message: Royboy: "RE: Returning Null value instead of contents of field"
- In reply to: shadow123: "Recordset Filter property and NULL"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Feb 2005 01:54:47 -0800
"shadow123" <shadow123@discussions.microsoft.com> wrote in message
news:B30783AB-0F55-44F0-AEDA-5A70D9A08119@microsoft.com...
> From what I read about ADO's Recordset's filter property the Value of the
> Filter criteria can not be NULL. Is there any way at all I could use the
> filter to screen for NULL and non-NULL values or am I pretty much doomed
> to
> modifying the WHERE clause.
>
> Something I would like to do but can't. Any ideas are welcome
> recordset.Filter = "FIELD1 IS NULL";
>
> Thank you so much.
What I've ended up doing to fill the same need is something of a kludge, but
it does work. I derive an additional field, passing the field that could be
null to COALESCE(), to provide a sort-of pseudo-null that can be tested
using recordset.Filter, e.g.,
SELECT *, COALESCE([field_could_be_null], '{{is_null}}') As test_for_null
FROM MyTable
Then I can filter using "test_for_null = '{{is_null}}'"
Note that my example is written for SQL Server, but most if not all db
engines support a comparable construct.
Good Luck,
Mark
- Next message: Stephen Howe: "Re: Returning Null value instead of contents of field"
- Previous message: Royboy: "RE: Returning Null value instead of contents of field"
- In reply to: shadow123: "Recordset Filter property and NULL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|