dateadd query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i need to make a query that calculates if an employee is past a 1 year
probation. i have an employee starting date field, and need to compare the
field to todays date. if the answer is past 365 days, the record is ignored.
if less then 365 days, the record goes to a report. i have been trying to
combine an iif statement with a dateadd statement, but with no luck. any
help would be greatly appreciated.
 
crhp917 wrote:

SELECT Mytable.employee
FROM Mytable
WHERE datediff("d",Mytable.Hiredate,Date())>365;

--
Regan,
Paeroa
World famous in New Zealand

Message posted via AccessMonster.com
 
You should be able to set a criteria under the [employee starting date] of
<DateAdd("yyyy",-1,Date())
 
Field: StartingDate
Criteria: > DateAdd("yyyy",-1,Date())

You can use
DateAdd("d",-365,Date())
If you want 365 days instead of one year (365 or 366 days- leap year)
 
Back
Top