Hi premkumarpeddinti,
Please find the sample code in sql.
-- SUBSTRING() function for older versions of SQL and SUBSTR() for newer versions of sql.
create table #temp(empname varchar(50), dob datetime)
insert into #temp values('Test1,'2018-03-01'),('Test2,'2018-04-24'),('Test3','2018-03-30')
declare @fd as varchar(50) = '01-03-2018'
set @fd = substring(@fd,7,4) + '-' + substring(@fd,4,2) + '-' + substring(@fd,1,2)
declare @ld as varchar(50) = '30-03-2018'
set @ld = substring(@ld,7,4) + '-' + substring(@ld,4,2) + '-' + substring(@ld,1,2)
select empname, dob from #temp where cast(dob as date) between (cast(@fd as date)) and cast(@ld as date)
Hope this will help you.
Regards,
Nirav Lalan
DNS Gold Member
"If you can dream it, you can do it."