Results 1 to 2 of 2

Thread: date diff from datagrid

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Posts
    1

    Exclamation date diff from datagrid

    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

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    The easiest way to do that is to add DateDiff function within your sql statement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width