locked
Difference between two dates RRS feed

  • Question

  • Hi All

    I have two dates columns in 2 different tables


    table1
    regid
    regdate

    table2
    regid
    logindate

    how to take the difference between these two dates,and find the average, in a stored procedure?

     

    Thanks

    Thursday, February 8, 2007 1:21 PM

Answers

  • Did you try something like

    Select AVG(DateDiff(dd, logindate, regdate))
    FROM Table1
    INNER JOIN Table2 On Table1.regid = Table2.regid
    Thursday, February 8, 2007 2:27 PM