This is driving me nut.
I’m simply trying to write the following query:
Meeting |> where([m], m.updated_at < ^DateTime.truncate(update_started_at, :second))
but I still get:
** (ArgumentError) :utc_datetime expects microseconds to be empty, got: #DateTime<2021-02-22 16:50:09.472646Z> Use `DateTime.truncate(utc_datetime, :second)` (available in Elixir v1.6+) to remove microseconds.
I also tried to apply the
truncate function to to
m.updated_at part of it but I also get an error.
I’m guessing I could make it work using
utc_datetime_usec but I don’t want to write a migration for such basic query.
There must be a way.
Btw: the documentation is pretty unclear on whether the truncate part should apply to the query side or to the interpolated side of the macro.
Thanks for the help