Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

CB Lists - Filter Operators

  • ahicks
  • ahicks
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
8 years 8 months ago #278210 by ahicks
CB Lists - Filter Operators was created by ahicks
The filter operators for a List do not include "Is Empty", "Is not Empty" might it be possible to add these operators sometime in the future?


I only ask so many questions because CB is so good :)

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 8 months ago #278232 by krileon
Replied by krileon on topic CB Lists - Filter Operators
Not needed, simply do an Equal To or Note Equal To and don't supply a value to match. Should give you the same results.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

  • ahicks
  • ahicks
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
8 years 8 months ago #278267 by ahicks
Replied by ahicks on topic CB Lists - Filter Operators
You are right, of course.

My problem was I was wanting to filter on an empty date field which actually isn't empty
but is 0000-00-00 so leaving blank doesn't work and comparing to 0000-00-00 or 0 doesn't either.

Achieved what I wanted by using contains or does not contain 201 which will work until 2020

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 8 months ago #278289 by krileon
Replied by krileon on topic CB Lists - Filter Operators
A date field with no value is always as follows.

0000-00-00

A datetime field with no value is always as follows.

0000-00-00 00:00:00

Matching against either of those in an equal to operator usage should work fine depending on the fieldtype. Not empty operator wouldn't help here though as this is a date field specific comparison. You may even need to use an advanced filter like the following.

`FIELD_NAME` NOT IN ( '0000-00-00', '0000-00-00 00:00:00', '' )

This covers basically all cases of not empty for date fields.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum