ASP.NET - VB.NET - How to do difference calculation between two date fields on a form and split the result between two other form textboxes (years and months)?
Posted on 2006-04-14
I have an aspx form where data entry is being done. I have these textbox fields on the form:
Date Collected: textbox
Date of Onset: textbox
I would like to be able to do a calculation, based on the dates entered in those two fields. I want to know the difference between date collected (later date) and date of onset (earlier date) and display the difference measured in how many years and months the difference is in two additional textboxes on the form (TimeSinceOnsetYrs, TimeSinceOnsetMonths).
Date Collected: 1/1/2006
Date of Onset: 12/1/2003
Time Since Onset: 2 years, 1 month
I want it rounded to the nearest whole month.
Can someone help me with how to implement this??