-1

Can someone let me know a simple way to get # of days in a month in HIVE SQL based on current_date. e.g. 2021-02-16 = 28 days, 2021-06-30 = 30 days etc

leftjoin
  • 36,950
  • 8
  • 57
  • 116
ash patel
  • 19
  • 2
  • 3
    Does this answer your question? [Find last day of a month in Hive](https://stackoverflow.com/questions/17548584/find-last-day-of-a-month-in-hive) – U880D May 30 '21 at 13:44

1 Answers1

0

Use

day(last_day(current_date))

last_day(date) returns last day date, day(date) returns day part of the date, int

See manual here: Language Manual - Date Functions

leftjoin
  • 36,950
  • 8
  • 57
  • 116