Problem with fetching value from naive_datetime field

I have a naive_datestamp field in my ecto scheme:
field :datestamp, :naive_datetime
Values in that field are stored automatically with NaiveDateTime.utc_now.

I use
Map.get(itm, :datestamp)
to get the the value of that field, where itm is a map with the results from a query (the result consists of only one record).
But I get an error. Where is the problem?

Hard to tell without seeing both the error and the definition of itm. :slight_smile:

IO.inspect itm, if I had to guess, I’d guess that your query returns a list of rows, even though the list has only one row…