Rounding??

  • Hi All:

    Is there a way to round the following to the 100th place on Datedifff?  I tried round function but I am getting an error. 

    SELECT  [Eligibility Month]

     ,[Plan]

     , MEMBID

     ,DOB

     ,(DATEDIFF(dd, DOB, '2006-01-01')/365) as AgeJan06

     

    Thanks in advance

    Shine

  • WHat is your deisred result?

    there are functions on this site that calculate a persons age.

    http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=326

     

      DECLARE @age_at INT

        SET @age_at = dbo.f_age_at ('2/16/1954', GETDATE ())

    what you are showing will not work.

  • I was trying to get a average of a person to hundreth place.  I was able to do it a 3 step process by putting into temp tables and I was able to get my desired results.

    But those functions will come in handy. 

    Thank you Ray.

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply