Answered Substracting date values

  • Tuesday, September 25, 2012 6:26 AM
     
     

    i have put 2 dates in  2 text boxes as issued date and return date.  i want to calculate the difference between those two dates. i want to subtract issued date from the return date and then need to get the answer in number of days.

    please some one help me to do this

    Thank you


    val_wick

All Replies

  • Tuesday, September 25, 2012 6:32 AM
     
     Answered Has Code

    Hi,

    you can use the subtract method of a date to subtract another date; it results in a

    Timespan

    object, which has a 'Days' and 'TotalDays' property.

    Debug.Print(Date1.Subtract(Date2).TotalDays.Tostring())


    Regards, Nico

  • Tuesday, September 25, 2012 6:35 AM
     
     
    ok thanks, i will try this

    val_wick