Skip to content
Advertisement

SQL code to project how many clients will reach age 55 each month for a year

I am trying to get the number of clients who are currently >= age 55, which I’ve managed, but next I want to find out how many people will be >= 55 in a month’s time, then in 2 month’s time etc up to 12 months.

Here is what I have so far, but I’m not sure how to go about the next bit. Any help greatly appreciated! Thanks.

The result I want for the next bit will be something like…

Example results

Advertisement

Answer

You would have to write multiple case statements like:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement