Solved

Compare two dates

Posted on 1999-01-11
3
116 Views
Last Modified: 2010-05-03
VB5
---
How can I compare two dates from the FileDateTime() function? I want to see which file is older.
0
Comment
Question by:liljegren
3 Comments
 

Author Comment

by:liljegren
ID: 1455352
Naturally, I don't want the program to crasch on a computer with another regional date setting. :-)
0
 
LVL 3

Accepted Solution

by:
jjbyers earned 50 total points
ID: 1455353
Use the DateDiff function. It will return the interval between the two dates.
0
 
LVL 18

Expert Comment

by:deighton
ID: 1455354
use CDbl to change the results of FileDateTime and store in double variables.  Compare the values - the higher the value the later the date.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 …
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…
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…

792 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