?
Solved

Getting a date difference between a certain date and current date

Posted on 2004-04-27
6
Medium Priority
?
143 Views
Last Modified: 2012-05-04
Hello!

If I have a String in the following format: 27.04.2004 12:10:05

How do I get the day difference between this String value and a current date?
0
Comment
Question by:agajewski
  • 3
3 Comments
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 500 total points
ID: 10925966
Hi agajewski,

Try this:

  Dim strDate As String
 
  strDate = "26.07.2004 12:10:05"
 
  MsgBox DateDiff("d", CDate(Replace(strDate, ".", "/")), Now())


BFN,

fp.
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 11257549
Well, "it works on my computer"... so I hope the points can be awarded to me :)

If agajewski replies back then we will have a clearer idea if the solution was suitable.

BFN,

fp.
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 11387180
I suggest that the question now be closed & points allocated accordingly.

Thank you.
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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 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