Solved

Compare Dates?????

Posted on 2002-04-21
4
125 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 69

Expert Comment

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

Accepted Solution

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

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

Expert Comment

by:KarcOrigin
Comment Utility
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
Comment Utility
thank you very much
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
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.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

744 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

13 Experts available now in Live!

Get 1:1 Help Now