I am trying to get a list of records that are for a certain date ($most_recent_date = '2022-06-22')
Here is an example of the field 'date':
2022-06-21 00:00:00
2022-06-21 01:01:01
2022-06-21 02:02:02
2022-06-20 03:03:03
2022-06-20 00:00:00
2022-06-22 00:01:01
2022-06-22 00:02:02
I want 2 records:
2022-06-22 00:01:01
2022-06-22 00:02:02
How would I write this query?
I tried the following but it does not work (Undefined column: "DATE(date)" does not exist):
$summery = records::selectRaw(
'license,
DATE(date) AS date_notime')
->where('DATE(date)', '=', $most_recent_date)
->groupBy('license', 'date')
->get();