How to find boundaries of rotating year in teradata

Database

How to find boundaries of rotating year in teradata

Hi,

I have an issue where i need to find the average of date in a rotating year.

example from date 01/10/2017 till 31/09/2018 result date should be 31/03/2018 for whole this period.

problem is how to find out this end dates in a rotating window? and then compute the average date

Please help me in solvimg this issue.

Thanks.

2 REPLIES
Teradata Employee

Re: How to find boundaries of rotating year in teradata

There is no 31 September, and it would be hard to determine exactly how you are defining "average date" with only one example. For instance, what happens when there are an even number of days in between the two dates, versus an odd number of days?

Might be just start_date + (end_date - start_date)/2.

Re: How to find boundaries of rotating year in teradata

Hi,

Thanks for the reply. I found some alternative to tackle this solution.

Regards,

Kal0203