Suppose I have two dates
- 2016-04-16 (yyyy-mm-dd)
- 2016-05-01(yyyy-mm-dd)
And I want to find birth date that falls between above two dates like birth date between '04-16'(mm-dd) and '05-01'(mm-dd)
Please help me to find this.
Suppose I have two dates
And I want to find birth date that falls between above two dates like birth date between '04-16'(mm-dd) and '05-01'(mm-dd)
Please help me to find this.
Simply use Between
SELECT * FROM yourtable WHERE DateOfBirth BETWEEN '2016-04-16' AND '2016-05-01'
UPDATE
Try this, it'll ignore the year part, using Convert
SELECT
*
FROM
yourtable
WHERE
CONVERT(varchar(5), DateOfBirth, 110) BETWEEN '04-16' AND '05-01'