3063 Posts in 864 Topics by 646 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 325 Views |
-
Getting DataObjects with NULL values

20 January 2012 at 11:00pm
Hi dear community
One of my models is an event (AgendaEintrag) with a DateField. If no date is set, the MySQL-Entry contains the value NULL. Now I'd like to display all Events without a date. This does not work:
$agendaEintraege = DataObject::get("AgendaEintrag", "Date=NULL", "Date ASC");
If I search for anything else, it works. I can for example display past events:
$agendaEintraege = DataObject::get("AgendaEintrag", "Date=<CURDATE()", "Date ASC");
Any idea how I can get those NULL containing entries? Thanks
-
Re: Getting DataObjects with NULL values

20 January 2012 at 11:06pm
how about "Date IS NULL" I think that is how MYSQL does it
-
Re: Getting DataObjects with NULL values

20 January 2012 at 11:08pm
Jackpot!
Wow, that was fast and the perfect answer. Thanks so much
| 325 Views | ||
|
Page:
1
|
Go to Top |


