I need to select records based on a range of month/day values, disregarding the year. I am querying an Access database, and I found a query here but it seems to select a range of years.
SELECT *
FROM Factory
WHERE YEAR(date) BETWEEN 1998 AND 1999
I have tried this query, but it only shows birthdays in the current year :
SELECT * FROM user where birthday Between #09/05# and #10/10#;
In my database the birthday column contains the year to count how old they are. What query can I use to perform what I want?
解决方案
Try
SELECT * FROM user
WHERE (month(birthday) * 100) + day(birthday) between 0131 and 1231