dateadd query

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.
 
R

Regan via AccessMonster.com

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
 
D

Duane Hookom

You should be able to set a criteria under the [employee starting date] of
<DateAdd("yyyy",-1,Date())
 
J

John Spencer

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top