Reputation: 5999
In Hive it's easy to get the day of X months later with add_months
, but how do I do the opposite?
Is there something like this in Hive?
sub_months("2018-03-11", 4) == "2017-11-11"
Upvotes: 1
Views: 965
Reputation: 4797
To get X months ago of a given month, you have just to add minus, for example:
select add_months('2018-03-11',-4);
Upvotes: 1