If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date Query using date in the date field
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 |
#2
|
|||
|
|||
Date Query using date in the date field
Shoan wrote:
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 Did ya try hitting the F1 key? The help is reasonable... Try DateAdd("d",[SomeDateField],90) -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200908/1 |
#3
|
|||
|
|||
Date Query using date in the date field
Try: [Departure Date] - Date = 90
Regards Kevin "Shoan" wrote in message news 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 |
#4
|
|||
|
|||
Date Query using date in the date field
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? -- Build a little, test a little. "Shoan" wrote: 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 |
#5
|
|||
|
|||
Date Query using date in the date field
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 '================================================= === Shoan wrote: 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 |
Thread Tools | |
Display Modes | |
|
|