Difference between two dates

  • Thread starter Thread starter P. B. Friday
  • Start date Start date
P

P. B. Friday

I am trying to create a queries that tell informs me when
an employe is one year before the retirement age of 62
and another one that notifies me five days before an
employee's date of birth. I assume that I have to use the
DATEDIFF functin. Help!
 
For Retirement list

SELECT * FROM TableName
WHERE DateAdd("yyyy",61,DOB) >= Date()

Or perhaps faster
SELECT * FROM TableName
WHERE DOB < DateAdd("yyyy",-61,Date())

For DOB and exactly five days.
SELECT * FROM Tablename
WHERE DateSerial(Year(Date()),Month(DOB),Day(DOB)-5) = Date()
 
Back
Top