user2795318
user2795318

Reputation: 33

Redshift DateAdd

I want to get first date of the month.

condition is : (current month - 36) so i have written like DATEADD(month, -36, getdate()) but it is giving the date like 2018-06-22 00:00:00 but I need the output like 2018-06-01 00:00:00

Br, Satish.

Upvotes: 1

Views: 632

Answers (1)

Sergey Geron
Sergey Geron

Reputation: 10232

Try date_trunc:

date_trunc('month', DATEADD(month, -36, getdate()))

Upvotes: 2

Related Questions