Date Query using date in the date field

S

Shoan

In my database I have a field in my personnel table that determines the date
when a person will leave. I've been trying to create a query that will give
me the number of days equal to 365 days or sometimes 90 days from that date.
I've tried this.

Criteria: Now() <= [type in number in days] departure date.

I'm so lost I don't know what to do anymore.

Shoan
 
K

KARL DEWEY

Can not figure what you want. Do you want all records that will be departing
in the next [type in number in days] number of days?
Or do you want to know who departed [type in number in days] number of days
ago?
 
J

John Spencer

You can use the dateadd function to add a number of days to a date.

If you are trying to find persons who have a departure date between
today and 365 days from today you could use

Criteria: Between Date() and DateAdd("D",365,Date())

You can replace the 365 with your parameter prompt.

Criteria: Between Date() and DateAdd("D",[Enter Number of Days],Date())

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

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

Similar Threads

Query Date Range 1
Date Range 7
Date Difference In Query 2
Date Brackets as an IIf statement 3
Calculated Field in Query - Date Format 5
Date Query 2
Date field in a query 2
Changing the parameters of a form 16

Top