I have a trouble with ecto query situation, that I Have a ORDER table with basic fields: current_status, picked_up_at, delivered_at, returned_at
. where: picked_up_at, delivered_at, returned_at
is Date type. and data struct i want to query back is: %{ current_status, date }
, where date is one of the value of [picked_up_at, delivered_at, returned_at]
it depends on value of current_status
if current_status
== "picked_up" so date in result will be picked_up_at
field and so on. the problem is i can create a dynamic query field in Select
query
Hope you guys can help! thank you!