Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,415 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,409 people online right now. Registration is fast and FREE... Join Now!




How to subtract two dates in VB

 
Reply to this topicStart new topic

How to subtract two dates in VB, taking the number of months, days, or years

marckiestar
15 Oct, 2008 - 03:38 AM
Post #1

New D.I.C Head
*

Joined: 21 Aug, 2007
Posts: 21



Thanked: 1 times
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

jjsaw5
RE: How To Subtract Two Dates In VB
15 Oct, 2008 - 04:03 AM
Post #2

I must break you
Group Icon

Joined: 4 Jan, 2008
Posts: 1,404



Thanked: 6 times
Dream Kudos: 125
Expert In: HTML, CSS, Database,

My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.



User is online!Profile CardPM
+Quote Post

marckiestar
RE: How To Subtract Two Dates In VB
15 Oct, 2008 - 04:16 AM
Post #3

New D.I.C Head
*

Joined: 21 Aug, 2007
Posts: 21



Thanked: 1 times
My Contributions
QUOTE(jjsaw5 @ 15 Oct, 2008 - 05:03 AM) *

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.

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.
User is offlineProfile CardPM
+Quote Post

jjsaw5
RE: How To Subtract Two Dates In VB
15 Oct, 2008 - 04:18 AM
Post #4

I must break you
Group Icon

Joined: 4 Jan, 2008
Posts: 1,404



Thanked: 6 times
Dream Kudos: 125
Expert In: HTML, CSS, Database,

My Contributions
Have you tired searching the internet for these examples? I'm sure there are plenty of examples on the net.
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:44PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month