I would like to know why sql query for month and year is working, and is not working for day:
string myQuery = "SELECT StudentName FROM Students WHERE " +
"YEAR(Birth) BETWEEN @yearFrom AND @yearTo AND " +
"MONTH(Birth) BETWEEN @monthFrom AND @monthTo AND " +
"DAY(Birth) BETWEEN @dayFrom AND @dayTo;
As said, for year and month query works fine, but it doesn`t work for day. Why is that so?