CREATE FUNCTION [dbo].[GetAge] (@BirthDate DateTime) RETURNS int AS BEGIN DECLARE @AgeValue int,@CurrentDate datetime SET @CurrentDate=GETDATE() IF ISDATE(@BirthDate)=1 BEGIN IF (MONTH(@CurrentDate)<MONTH(@BirthDate)) BEGIN SET @AgeValue = (YEAR(@CurrentDate)-YEAR(@BirthDate))-1 END ELSE BEGIN SET @AgeValue = (YEAR(@CurrentDate)-YEAR(@BirthDate)) END END ELSE BEGIN SET @AgeValue = 0 END RETURN(@AgeValue) END
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add support@netstaircom.net to your trusted senders list in your email software.