No announcements

### Calculate age with decimals when age < 0 and no decimal when age >0

Hope this help ;WITH CTE_CalAge(DOB) AS ( SELECT '07/16/1997' UNION ALL SELECT '09/04/2013' ) SELECT ...
| 10 Replies | 3800 Views | Created by sql9 - Wednesday, August 27, 2014 3:09 PM | Last reply by George Robertson Jr - Thursday, August 28, 2014 10:40 AM

### Calculate Age

Here's a more "exact" representation of the Years,Months,Days solution: declare @birthdate datetime set @birthdate='1959-10-08' select ...
| 7 Replies | 5507 Views | Created by Kaleeswara Murthy - Wednesday, May 20, 2009 5:55 PM | Last reply by Brad_Schulz - Thursday, May 21, 2009 4:28 PM

### How to assign a calculated age = '<1' when it is zero?

But &lt;1 is not an integer.
| 4 Replies | 1959 Views | Created by Sally Lue - Monday, March 4, 2013 10:22 PM | Last reply by Sally Lue - Monday, March 4, 2013 11:18 PM

### Calculate the Age

WHERE DOB &gt;= DATEADD(year, DATEDIFF(year, 0, CURRENT_TIMESTAMP), 0) - 60 AND DOB &lt; ...
| 17 Replies | 6423 Views | Created by Sqlstar07 - Saturday, June 25, 2011 2:21 PM | Last reply by Kalman Toth - Saturday, July 2, 2011 12:31 PM

### calculate age in stored procedure

TOPIC_ID=62729 create function ...
| 15 Replies | 13715 Views | Created by Jassim Rahma - Monday, January 25, 2010 10:44 PM | Last reply by Marc Talbot - Friday, January 29, 2010 1:20 AM

### t-sql 2012 calculate age

Declare @Test Table(EmpName varchar(40), BirthDate date); Insert @Test(EmpName, BirthDate) Values ('30 Yrs old yesterday', DateAdd(day, -1, DateAdd(year, -30, ...
| 7 Replies | 6531 Views | Created by wendy elizabeth - Monday, September 1, 2014 3:25 AM | Last reply by Howard Rothenburg - Friday, April 15, 2016 8:18 PM

### Calculate Age with DOB column

As a custom Date_Age function: (birthDate as date) =&gt; let     CurrentDate = ...
| 12 Replies | 18222 Views | Created by Otto Knoke - Tuesday, October 13, 2015 3:15 PM | Last reply by lrnative - Thursday, February 28, 2019 4:16 PM

### Calculating age by means of a parameter

Hi Rita, You can use the expression below to calculate the employee's age by reference date.
| 4 Replies | 2689 Views | Created by Rita211 - Wednesday, May 29, 2013 2:06 PM | Last reply by Uri Dimant - Wednesday, June 5, 2013 11:34 AM

### calculating an age range correctly.

Then created a line of code to call that function and push in DOB and getdate() to get me the calculated age.
| 3 Replies | 1003 Views | Created by cr_banks - Friday, August 26, 2016 2:01 AM | Last reply by Sam Zha - Friday, August 26, 2016 3:07 AM

### Age calculation in that Fiscal year

I tried with below modified query but it didnt work: SELECT * FROM  Table WHERE ...
| 10 Replies | 1092 Views | Created by Glenn345 - Thursday, July 12, 2018 7:37 PM | Last reply by Will_Kong - Monday, July 16, 2018 9:17 AM

### Age calculation in report builder query

365.25 takes into account leap year math when dealing with calculations finding a year by dividing by number of days.
| 10 Replies | 11762 Views | Created by Wass5 - Wednesday, November 13, 2013 9:36 PM | Last reply by Kalman Toth - Tuesday, September 23, 2014 6:45 AM

### Calculate Average Age in SSAS

[ApptCount]), FORMAT_STRING = "0", VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Measures'; KDW
| 3 Replies | 2230 Views | Created by siera_gld - Monday, February 29, 2016 9:02 PM | Last reply by siera_gld - Wednesday, March 2, 2016 4:22 AM

### calculate age from current date

i used this and it works perfectly based upon the month to the current date CASE    WHEN (c.BirthdayNum &lt;= 0 ...
| 6 Replies | 6070 Views | Created by sharmt - Friday, May 13, 2011 12:41 PM | Last reply by Mr. Wharty - Friday, May 13, 2011 10:54 PM

### AGE CALCULATION IN YEARS AND MONTHS

SELECT DATEDIFF(MONTH,CASE WHEN DAY(@setdate) &gt; DAY(@asof)THEN DATEADD(MONTH,1,@setdate)ELSE @setdate END,@asof) / 12 AS ...
| 9 Replies | 20335 Views | Created by Reddy84 - Thursday, March 18, 2010 4:50 PM | Last reply by Infant Fernando - Monday, July 31, 2017 2:22 PM

### Calculate item age for list item

Hi first remark calculated columns are updated only when an item is modified/updated For your example , keep Today Column, ...
| 3 Replies | 2323 Views | Created by Jiniv Thakkar - Monday, January 16, 2017 7:35 AM | Last reply by SibyM - Thursday, June 21, 2018 3:35 PM

### Help in calculate the age as per condition

--Exptected output B_ID  Age 122   70 124   60 126   ...
| 8 Replies | 971 Views | Created by Khan_K - Tuesday, May 17, 2016 8:11 PM | Last reply by Stan210 - Wednesday, May 18, 2016 12:31 PM

### Finding the Age

Hi Murli You can try following SQL to calculate Age.
| 6 Replies | 2876 Views | Created by Murali_CHN - Thursday, May 3, 2012 9:07 AM | Last reply by Paresh Patel - Thursday, May 3, 2012 10:44 AM

### under the age of 19

You have their DOB, so why calculate the age?
| 12 Replies | 3925 Views | Created by samd12 - Tuesday, June 2, 2009 11:43 PM | Last reply by Adam Haines - Wednesday, June 3, 2009 10:11 PM