From: Gert-Jan Strik on
Try this:

Declare @BirthDate datetime
SELECT @BirthDate='19650531'

SELECT DateDiff(year,@BirthDate,CURRENT_TIMESTAMP)
- CASE WHEN DateAdd(year,
DateDiff(year,@BirthDate,CURRENT_TIMESTAMP), @BirthDate) >
CURRENT_TIMESTAMP THEN 1
ELSE 0 END

--
Gert-Jan


qjlee wrote:
>
> I have a table called member, in which contains memberid and dob. How can I
> calculate memberid's age based on DOB
>
> Thanks,
> qjlee