Date Difference - well, sort of...

# Thread: Date Difference - well, sort of...

1. Senior Member
Join Date
Dec 1969
Posts
279

## Date Difference - well, sort of...

Hi all,<BR><BR>I am able to display the difference between 2 dates in days, months or years, but can someone show me how to display the difference with all 3?<BR><BR>I.e. If the start date is 1/1/2002 and the current date is 2/4/2003. It will be displayed as "1 year, 4 months and 1 day"<BR><BR>thanks all,<BR><BR>KS

2. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## If you know how to..

.. get each piece, just put it together.<BR>[code language="VB.NET"]<BR>Dim x As String = "hello"<BR>Dim y As String = "world"<BR>Dim z As String = x & ", " & y<BR>[/code]

3. Senior Member
Join Date
Dec 1969
Posts
279

## RE: I want the remainder of the difference too.

If the date range is 1/1/2002 - 2/4/2003<BR><BR>I dont just want, 366 days, 16 months & 1 year<BR><BR>I need the remainder to be displayed in months and days<BR><BR>e.g., 1 year, 4 months & 1 day<BR><BR>Make sense?<BR><BR>thanks<BR><BR>KS

4. Senior Member
Join Date
Dec 1969
Posts
4,697

## RE: I want the remainder of the difference too.

&nbsp;<BR>Get the year of each, and get the difference.<BR>Do the same for the months and the days.<BR><BR>LOL

5. Senior Member
Join Date
Dec 1969
Posts
279

## RE: I want the remainder of the difference too.

Could you elaborate on that a bit!

6. Senior Member
Join Date
Dec 1969
Posts
4,697

## RE: I want the remainder of the difference too.

No, you should look at the documentation for dates, then you will see how trivial it is.

7. Senior Member
Join Date
Dec 1969
Posts
279

## RE: I want the remainder of the difference too.

If i had figured it out from the documentation I wouldnt be posting here.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•