View Full Version : Trying to filter for null


mg123
05-06-2008, 08:35 AM
Can anyone tell me what syntax I need to use in order to specify that I want my filter to be something like "FieldName is null" when using the filter property for a report?

I have a report that gets run by the user first going to a drop down list and selecting the table that they want the report to be run against. Then they click the button for the report that they want and the report is launched. When I go into the properties for the report and adjust the filter it seems to work just fine and filter as expected for just about any filter that I set. However, when I try to set the filter to only return records where a particular field is null no matter what I try it doesn't seem to like my syntax. Any help will be appreciated. Thanks!

KenHigg
05-06-2008, 08:36 AM
=Not IsNull([MyFieldname])

???

mg123
05-06-2008, 08:43 AM
Ken,
Thanks for the quick reply, but no luck... I am trying to set this filter using the Filter field in the Property Sheet. I tried your experession exactly as you wrote it and when that didn't work I tried every permutation of it that I could come up w/ but no dice...

If there are any other suggestions out there I would GREATLY appreciate it. Thanks!

MSAccessRookie
05-06-2008, 10:05 AM
when I try to set the filter to only return records where a particular field is null no matter what

Sounds like you want ONLY Null entries. I think that would mean:

IsNull([MyFieldname]),

OR

([MyFieldname] IS NULL)

Both of these Formats have worked for me

Note: I am sure you noticed the syntax error in the IsNull Statement and corrected it, but I am fixing it anyway.

mg123
05-06-2008, 10:10 AM
Thanks, I tried both of your suggestions (and several other permutations of them) but still no luck. I think the key to this is that I am required to use the Filter field in the Properties window and for some reason it seems that this field only recognizes a subset of the syntax that would work in a where clause.