joseph.larrew
Registered User.
- Local time
- Today, 07:22
- Joined
- Oct 26, 2010
- Messages
- 13
Hey all, just joined up and I'm excited to see if I can get my problem resolved. Now, I am pretty new to databases and SQL, so you might have to be pretty basic with me. I'm trying to query a table with a bunch of birthdates in it, and I'm trying to find records that are 3 months away from turning 18. I've been trying to use the DateDiff function as follows:
SELECT Patient.[Patient ID], Patient.[Last Name], Patient.[First Name], Patient.[Date of Birth]
FROM Patient
WHERE DateDiff("yyyy", Date(), Patient.[Date of Birth]...)
And that's where I'm kinda stuck. I can't really say "=18" or "<18" or anything like that. I'm trying to find those who fall within a 3 month window. Any ideas? I'm sure it can be done.
Thanks,
Joseph
SELECT Patient.[Patient ID], Patient.[Last Name], Patient.[First Name], Patient.[Date of Birth]
FROM Patient
WHERE DateDiff("yyyy", Date(), Patient.[Date of Birth]...)
And that's where I'm kinda stuck. I can't really say "=18" or "<18" or anything like that. I'm trying to find those who fall within a 3 month window. Any ideas? I'm sure it can be done.
Thanks,
Joseph