Solved

Data calc

Posted on 2000-05-09
4
179 Views
Last Modified: 2010-05-02
I need to take a date inputed by the user and substract that date up to 24 months.  The Database has the dates as 01/01/00, we were planning to enter it the same way.  But I am open the requirement is to be able to take the end date the user input and subtract up to 24 months for the start dated of the search.  So what I am looking for is ideas to achive this in code.
0
Comment
Question by:akeyes
  • 3
4 Comments
 
LVL 14

Expert Comment

by:mcrider
ID: 2792577
Using the DateAdd function, you can add and subtract time intervals from dates...

For example, this adds 1 month to now:   dateadd("m",1,now)

This subtracts 1 month from now:  dateadd("m",-1,now)


Cheers!®©
0
 
LVL 14

Accepted Solution

by:
mcrider earned 100 total points
ID: 2792602
You can also do this:

x=dateadd("m",-24,"01/01/00") 'will return the date 1/1/98

Cheers!®©
0
 

Author Comment

by:akeyes
ID: 2800936
Thank you, I knew it was something simple.  I just could not for the life of me find it.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2803109
Thanks for the points! Glad I could help!


Cheers!®©
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
using Access 8 59
Hide vba in gp 7 83
Passing a Text Box name to a Sub 6 79
VB6 ListBox Question 4 34
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now