How to Calculate the difference between two dates <p>I have this code:</p> <pre><code>Private Sub CalculateBUT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateBUT.Click If SelectTheDateComboBox.Text = "Calculate the difference between two dates" Then FromYearTextBox.Text = FromDateTimePicker.Value.Year FromMonthTextBox.Text = FromDateTimePicker.Value.Month FromDayTextBox.Text = FromDateTimePicker.Value.Day ToYearTextBox.Text = ToDateTimePicker.Value.Year ToMonthTextBox.Text = ToDateTimePicker.Value.Month ToDayTextBox.Text = ToDateTimePicker.Value.Day Dim DaysMyString, MonthsMyString, YearsMyString As String Dim DaysDifferance, MonthsDifferance, YearsDifferance As Long DaysMyString = FromDateTimePicker.Value.Day MonthsMyString = FromDateTimePicker.Value.Month YearsMyString = FromDateTimePicker.Value.Year DaysDifferance = DateDiff(DateInterval.Day, ToDateTimePicker.Value.Day, CDate(DaysMyString)) MonthsDifferance = DateDiff(DateInterval.Month, ToDateTimePicker.Value.Month, CDate(MonthsMyString)) YearsDifferance = DateDiff(DateInterval.Year, ToDateTimePicker.Value.Year, CDate(YearsMyString)) DifferenceTextBox2.Text = DaysDifferance &amp; "Days, " &amp; MonthsDifferance &amp; "Months, " &amp; YearsDifferance &amp; "Years" End Sub </code></pre> <p>and my problem in the picture below : <img src="https://i.stack.imgur.com/fLzgA.png" alt="enter image description here"></p> <p>so, i need some help please.</p>