PDA

Click to See Complete Forum and Search --> : date diff from datagrid


Fraggle
Oct 27th, 2004, 04:24 AM
hi,
im running vb.net front end and access database.
i understand the date diff process, no probs, but
in vb datestart and dateend are converted from string to date format and added to a data grid.
this is stored in a table in access, via dataset.
i have multiple rows and want to find the date diff between each datestart and dateend in each row and add together.
how do i call on the startdate cell in the datagrid.

example...
row one column 4 - 1/1/2000 -> row one column 5 - 1/12/2000 = 1 year
row one column 4 - 1/1/2001 -> row one column 5 - 1/7/2001 = 6 months
row one column 4 - 1/1/2002 -> row one column 5 - current date = 2 yrs, 10 months, 27 days

label total = 4 yrs, 4 mnths, 27 days roughly

Serge
Oct 29th, 2004, 04:19 PM
The easiest way to do that is to add DateDiff function within your sql statement.