How do I calculate the number of days between 2 dates

  • Thread starter UNI-SOURCE Office User
  • Start date
U

UNI-SOURCE Office User

I have a date and need to know the number of days between that date and the
current date to be included in my word document.
 
D

Dave Lett

Hi,
You can use the DateDiff function, as in the following example:

Dim dFirstDate As Date
dFirstDate = "1/1/06"
MsgBox DateDiff("d", dFirstDate, Date)


HTH,
Dave
 
U

UNI-SOURCE Office User

OK, maybe I put it in the wrong category. I have to make this a user
function of setting up the word templete(word document for mail
merge.....maybe wrong term). I am not aware of how I include VB code in it,
but maybe I can. If I can please explain
 
D

Dave Lett

Hi,

I really have no idea what you're asking. Are you setting up a word
template? Are you creating a mailmerge? Do you know? Is the user setting up a
template? Is the user setting up a document that they'll (mis)use as a
template? Do you simply want to include a field in a document/template that
will show the number of days between two dates (one of which is the current
date)?

Dave
 

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