nolwww
nolwww

Reputation: 1715

Drop a part of a timestamp

I want to drop a part of a time stamp.

Example:

2014-02-22 21:30:40.000000

to

2014-02-22

What is the quickest way to do it with redshift?

Upvotes: 0

Views: 55

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269563

You can convert to a date:

timestamp_col::date

Or use date_trunc():

date_trunc('day', timestamp_col)

Upvotes: 1

Related Questions