Solved

Compare Dates?????

Posted on 2002-04-21
4
128 Views
Last Modified: 2010-05-02
how could I take a date in the format 12/03/2000 and programatically determine how many days have past to present date.
E.G
12/03/2000 to 04/21/2002 how many days have past
0
Comment
Question by:hilltop
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6958710
use the DateDiff function like this:
msgbox datediff("d",#2000/03/12#,date)
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 140 total points
ID: 6958712
I mistype your date. You should read:

msgbox datediff("d",#12/03/2000#,date)
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 6958747
Hi,

You can use it like this too:

DateDiff("d", Format("11/03/2000", "MM-DD-YYYY"), Format("12/03/2002", "MM-DD-YYYY"))

Thanks.

0
 
LVL 2

Author Comment

by:hilltop
ID: 6958810
thank you very much
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

820 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