Solved

Getting a date difference between a certain date and current date

Posted on 2004-04-27
6
135 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
6 Comments
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 125 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

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

829 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