Could somebody please help me figure out how to make a ORM sql query on a dataobject that returns the count of dataobjects created today. Cant figure it out in the new SS3 ORM.
Found a solution that seems to work:
DB::query("SELECT count(*) FROM Invoice WHERE Created BETWEEN '".date('Y-m-d')." 00:00:00' AND '".date('Y-m-d')." 23:59:59'")->value()
And that seems to be the right way
$count = Invoice::get()->filter(
'Created:GreaterThan' => date('Y-m-d').' 00:00:00',
'Created:LessThan' => date('Y-m-d').' 23:59:59'