Hello All,
My query is:
Select Reg_year, count(*) as Total
From t_Data FR
Where fr.STATE_CD=35
and fr.Insert_DATA_Date >= '2017-01-01 15:25:16.437'
and fr.Insert_DATA_Date <= '2019-12-01 15:25:16.437'
group by Reg_year
Problem: date filter is not working.
Output comes like:
Reg_Year | Total
-------------------------------
2015 | 6
2016 | 9
2017 | 13
2018 | 11
Thanks in advance

Jignesh KumarPosted Jan 7, 2020, 10:08 PM
Rajanikant HawaldarPosted Jan 7, 2020, 5:34 AM
Ankit ShuklaPosted Jan 7, 2020, 5:17 AM
Amit MohantyPosted Jan 7, 2020, 4:29 AM
Rajanikant HawaldarPosted Jan 7, 2020, 3:59 AM
Ankit ShuklaPosted Jan 7, 2020, 3:52 AM
Select Reg_year, count(*) as Total
From t_Data FR
Where
fr.Insert_DATA_Date between CONVERT(datetime,'2017-10-17') AND CONVERT(datetime,'2020-10-18')
and fr.STATE_CD=35
group by Reg_year
Rajanikant HawaldarPosted Jan 7, 2020, 3:18 AM