Thanks for your reply,
If we have only one date yes we can add this function directly, But For ex( as I mentioned 3 years and start date is 2021 -05-01 ) then need to derive 3rows like below
The issue with your existing table is that the NoYears column is not numeric (i.e., character like "1year".) Instead if had just numbers, that would make the query much easier.
Also, you will need a numbers table in your database. If not, construct one as in the example below, where I am assuming NoYears column is numeric
;WITH Numbers(N) AS
(
SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3
)
SELECT
id,
NoYears,
DATEADD(YEAR,n.n-1,startdate),
DATEADD(DAY,-1,DATEADD(YEAR,n.n,startdate))
FROM
YourTable t
INNER JOIN Numbers AS n ON
n.n <= t.NoYears