Link to home
Start Free TrialLog in
Avatar of kdeutsch
kdeutschFlag for United States of America

asked on

finding difference between dates

What I am trying to do is take todays date and find the difference in years from another date, I don't want it to round, so if its 6.5, 6.2, 6.7, 6.8 it woould all be 6 years.  i thought about using the  GetDate function but don't know how to use the syntax or even if thats what to use.  Thanks

Select      m.dtStartDate,
            m.dtEnddate,
            p.strSSN,
            s.sidstrNAME_IND,
            s.sidstrGR_ABBR_CODE + '/' + s.sidstrPay_GR as Rank,
            GetDate s.siddatPEBD
from                           tblSadMission as m INNER JOIN
            tblAssignedPersonnel as p on p.strssn = p.strssn INNER JOIN
            cms.dbo.tblSidpers as s on p.strssn = s.sidstrssn_SM
SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kdeutsch

ASKER

I added an extra 25 points so I could award to the first answer because it was correct but I needed the FLOOR comment in there to reuturn  it properly for calculations I had to be sure it alwasy rounded down.