add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select 'ABC' Emp, Cast('19910310' as date) Dob into #t union all
select 'XYZ', cast('19921201'as date) union all
select 'AJM', cast('19920820'as date) union all
select 'RNM', cast('19910710'as date)
4 rows affected
declare @start date='20200101', @end date='20200331';
select *
from #t
where
(Floor(DateDiff(dd,dob,@end) / 365.25))-(Floor(DateDiff(dd,dob,@start) / 365.25))=1
Emp Dob
ABC 1991-03-10
declare @start date='20200301', @end date='20210115';
select *
from #t
where
(Floor(DateDiff(dd,dob,@end) / 365.25))-(Floor(DateDiff(dd,dob,@start) / 365.25))=1

Emp Dob
ABC 1991-03-10
XYZ 1992-12-01
AJM 1992-08-20
RNM 1991-07-10