1,676 articles and 12,446 comments as of Thursday, August 26th, 2010

Friday, January 23, 2009

Filter by an Empty Field

I ran into a little quirk this morning that turned out to have an interesting solution. When authors submit articles to the Article Submission Library at EndUserSharePoint.com, there is a date column named “Actual Publication Date” to compare against the “Scheduled Publication Date”.

I want to create a view that shows only the articles that have not been published.

My first pass used the filter section to say “Show items when Actual Publication Date is greater than 1/1/2008″. I figured since it was a date column, any item that had a date in that field would not show up in the view. Nope… didn’t work.

Then I thought “What if you filter for an empty field?” So this time, I set filter to “Show items when Actual Publication date is equal to” and left the value field empty…. Score!!!

Weird one… don’t compare against the date, just leave the filter value empty. You learn something new everyday.

 

Please Join the Discussion

7 Responses to “Filter by an Empty Field”
  1. Erich O'Donnell says:

    I had this problem recently and tried this option, but because I was trying to filter on a rich tex, multiple lines field, it wouldn’t let me filter on a null value. To get around this I had to develop a page that displayed info called through the web service on the list.

    Does anyone know of a simpler way to do this?

  2. Rik says:

    Do you also have a solution when you want to do the same for a content by query webpart on a publishing page? i want to filter by an optional date & time field that holds an custom expiration date (”show on frontpage untill”)…

    Kind regards,
    Rik

  3. Sarah says:

    Thanks so much for this info! I just spent about 20 minutes trying to figure this out and used “contains” instead of “is equal to” and left it empty but that didn’t work. Your solution was perfect!

  4. Ben says:

    Thank for this.

  5. Marilyn Greenwell says:

    Trying to do just the opposite of this task with a multiple lines of text field. Any suggestions? I want to display only the items that have content in a certain field/column.

  6. Ken K says:

    When I used as second or third filter the empty filter did not work (no errors and it did not filter the field). The empty filter worked only after I placed as the first or only filter.

    Thanks


Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!