Skip to content
Advertisement

Calculate years based on months in SQL Server

I want to write a function that takes the number of months as a parameter and does the following:

I can hardcode all of this using case statements but I wanted to know if there is a dynamic way of doing it. Thanks!

Advertisement

Answer

Try this:

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