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
SQL

Avatar of undefined
Last Comment
kdeutsch

8/22/2022 - Mon
SOLUTION
Aneesh

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
HetAlps

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
kdeutsch

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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes