M
M
Maxim2016-04-27 12:05:39
PostgreSQL
Maxim, 2016-04-27 12:05:39

Trim date in PostgreSql?

In sql query I use SELECT date_trunc('day', table.created) AS day and .... further query.
as a result, I get the date in the form 2016-03-28 00:00:00.000000 , how can I cut this date in the query to look like 2016-03-28?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2016-04-27
@KidsBout

You just need to put day(table.created) instead of date_trunc('day', table.created)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question