Subject | Re: [IBDI] Calculating Age of a person without using free udf's |
---|---|
Author | ivpi |
Post date | 2001-06-21T14:26:43Z |
Age ?
In years ?
If yes something like this :
jj = 1800 ;
startdate = cast( '1/1/' || jj as date ) ;
while startdate < birthdate do
begin
jj = jj + 1 ;
startdate = cast( '1/1/' || jj as date ) ;
end;
ii = 1800 ;
startdate = cast( '1/1/' || ii as date ) ;
while startdate < cast ( 'today' as date ) do
begin
ii = ii + 1 ;
startdate = cast( '1/1/' || ii as date ) ;
end;
age = ii - jj ;
Not tested code just invented on the fly .
I hope useful .
Aldo
In 15.31 21/06/2001 +0200, hai scritto:
In years ?
If yes something like this :
jj = 1800 ;
startdate = cast( '1/1/' || jj as date ) ;
while startdate < birthdate do
begin
jj = jj + 1 ;
startdate = cast( '1/1/' || jj as date ) ;
end;
ii = 1800 ;
startdate = cast( '1/1/' || ii as date ) ;
while startdate < cast ( 'today' as date ) do
begin
ii = ii + 1 ;
startdate = cast( '1/1/' || ii as date ) ;
end;
age = ii - jj ;
Not tested code just invented on the fly .
I hope useful .
Aldo
In 15.31 21/06/2001 +0200, hai scritto:
>Hi, can anybody help me, I am trying to correctly calculate the age of a
>person if I have his birth date and today's date in a stored procedure. We
>are not allowed to use the Free UDF's to do it. (management decision)
>
>Any help will be appreciated
>Louis Werth
>
>
>
>Community email addresses:
> Post message: IBDI@yahoogroups.com
> Subscribe: IBDI-subscribe@yahoogroups.com
> Unsubscribe: IBDI-unsubscribe@yahoogroups.com
> List owner: IBDI-owner@yahoogroups.com
>
>Shortcut URL to this page:
> http://www.yahoogroups.com/community/IBDI
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>