Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

where statement with dates in future?? 1

Status
Not open for further replies.

Irishiii75

Technical User
Jul 27, 2001
9
US
I need to find people with a bringup date two months in the future. So, if my query is run today, 08/01/2001, I need to find those with bringup dates 10/anyday/2001.

Is there a way to write that without having to enter the range of dates as below?

genDependent.FTStudentBringUpDate BETWEEN CONVERT(DATETIME, '10/01/2001',101)AND CONVERT(DATETIME, '10/31/2001',101)

Thanks

 

Try this in your criteria. Use the Month function.

Month(genDependent.FTStudentBringUpDate)=Month(getdate())+2 Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Thanks for the help.

I was able to get the data I needs.

 
I need a calculation that will create future years.

I.E. I am working on a stock tracking database and my big challege is creating a form where an end-user can select the number of years an award will vest, and then have Access divide that amount into the future.

Example: I received $60,000 on 09/01/2002 as an award. It will vest over 6 years (10,000/yr). So in 09/01/2003 I will have 10,000 vested and $50,000 unvested.

I do not want to have to manually create future years. Is thier a calc. I can use to do this?
 
I would like to learn of a macro (or VB) command that can automatically create dates in the future.

I.E 7-01-2002, 7-01-2003, 7-01-2004, etc...

I want to be able to click a button and create these future years.
 
1) This is a SQL Server forum not an Access or VB forum. Try forum705 "Microsoft: Access Modules (VBA Coding)." It is a much better place to search for Access/VBA coding solutions.

2) Access and VB have the dateadd function. For example, the following gives the date six years in the future.

Dateadd("yyyy",6,date()) Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top