getRecords - Date Field Filter

4 posts by 3 authors in: Forums > CMS Builder
Last Post: January 29, 2013   (RSS)

Hello, All

I need to define a where clause in a getRecords function that will filter out a particular field. In this instance the field in question is a date field. I want getRecords to bypass all records in which a date has been submitted. In effect it needs to say:

where => ' date is empty ' 

Or some such thing!

:0)

Perch

I too just finished struggling with this problem except I needed all with no date where you need the opposite.

I found that this works but don't know if there is a better way:

'where'    => "ship_date != '0000-00-00 00:00:00'",  // filters out all with no date.

since date fields are stored padded with zeros and is not as a NULL

Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987

Cheers Ron. Works perfectly!

:0)

Perch