Extract date only from Windows serial date

D

dedawson

I want to compare a user-specified date, such as 3/3/2010, with the
date associated with a tracked change. The problem is
ActiveDocument.Revisions(1).Date also returns the time of day. I have
come up completely empty on the means of referencing the date portion
only of the tracked change. Sure hope someone can educate me, as I'm
sure I've got to be missing something incredibly obvious.
 
M

macropod

Hi dedawson,

Sub Test()
MsgBox Format(ActiveDocument.Revisions(1).Date, "DD/MM/YYYY")
End Sub
 
D

dedawson

Format(ActiveDocument.Revisions(1).Date, "DD/MM/YYYY") doesn't get me
there, as it returns a string and the Revisions(1).Date is a real
date. Converting the revision date to a string results in collating
issues I'd like to avoid coding for.

But, you did get me to thinking a little further, which yielded the
answer:

Int(ActiveDocument.Revisions(1).Date) solves the problem since time
during the day is maintained as a decimal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top