Hi, First of all, I'm sorry if my english is bad, I'm from israel.
I want to make a query that checks if someone is 3 years old. I have his birthday and I need to check this:
actual date right now - 3 years >= birthday
how can I do it?
Hi, First of all, I'm sorry if my english is bad, I'm from israel.
I want to make a query that checks if someone is 3 years old. I have his birthday and I need to check this:
actual date right now - 3 years >= birthday
how can I do it?
Use DateDiff function.
SELECT * FROM tablename WHERE DateDiff("yyyy",[BirthDate],Date())>=3;
How precise do you need this calculation? Even if birthdate is in July, that year will be counted as full year. DateDiff rounds. The following will calculate fraction of year.
DateDiff("m",[BirthDate],Date())/12
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.