How to subtract two dates in VB

taking the number of months, days, or years

Page 1 of 1

3 Replies - 8402 Views - Last Post: 15 October 2008 - 05:18 AM Rate Topic: -----

#1 marckiestar  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 21-August 07

How to subtract two dates in VB

Post icon  Posted 15 October 2008 - 04:38 AM

Hi! I'm working on a Library System for my Project! This is the case, I wanted to know what is the syntax on how to get the difference of two dates, to be exact, the total number o days between the two dates.

[b]I am thinking of this one, DiffDate(Interval as String,Date1,Date2)

I don't really know how to use it, for example, I have two dates:

BorrowDate = 8/02/2008
ReturnDate = 10/18/2008

an you give me the syntax for this? I wanted that it will return the total number of days between these two dates.
Please give examples.

Is This A Good Question/Topic? 0
  • +

Replies To: How to subtract two dates in VB

#2 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: How to subtract two dates in VB

Posted 15 October 2008 - 05:03 AM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 marckiestar  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 21-August 07

Re: How to subtract two dates in VB

Posted 15 October 2008 - 05:16 AM

View Postjjsaw5, on 15 Oct, 2008 - 05:03 AM, said:

[rules][/rules]

Hi!

The code is quite long, Im now working on the process of returning books, I'm done with Borrower Registration, Payment for registration, and activation of the three library cards.

I just wanted to know the syntax on how to subtract two dates, so that I would be able to compute the necessary penalty for the excess days.

It doesn't mean that I don't do the coding, I just want the syntax, so that I would know. Just examples.
Was This Post Helpful? 0
  • +
  • -

#4 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: How to subtract two dates in VB

Posted 15 October 2008 - 05:18 AM

Have you tired searching the internet for these examples? I'm sure there are plenty of examples on the net.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1