What would be the best solution for int_months_between
in weeks for Impala?
Would I have to work with Invervals
or what is the best recommendation.
Asked
Active
Viewed 139 times
1 Answers
0
The easiest way would be to use datediff
function, which returns difference in days, and then to divide the result with 7. It will not be precise in terms of business weeks, and there might be some ambiguous results at the beginning or end of the year, but in general it should do the trick. This is function signature for Impala 5.8.x:
datediff(timestamp enddate, timestamp startdate)

Matko Soric
- 107
- 3
- 16