So I have a gridview with ‘dateborrowed’ and ‘datereturned’. What I want is that the program will count for the number of days in between the ‘dateborrowed’ and ‘datereturned’ like for example ‘dateborrowed’ = April 1, 2011 – ‘datereturned’ = April 30, 2011 = 29 days in between. Also I want the value to automatically insert to a record ‘daysibetween’. So how can I do that?
Help would be much appreciated. Thanks in advance!!
There are several ways you can accomplish this
A very much neat way
taken from
Calculate difference between two dates (number of days)?
OR
They were all taken from this thread in MSDN.
Once calculated, adding it to the database is an
UPDATEquery.