Solved

Data calc

Posted on 2000-05-09
4
186 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA Shell can't Find Word document 11 155
TT Auto Dashboard 13 104
VB6 - Cannot type when doing an extract from MSHFlexgrid to Excel 6 47
Collapse and expand table in Word 2010 2 153
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

738 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