You are here: Re: SQL needs AGE function. « PHP SQL « IT news, forums, messages
Re: SQL needs AGE function.

Posted by J.O. Aho on 01/06/08 08:50

Skybuck Flying wrote:
> Hello,
>
> I want to select people from a database within a certain age range.
>
> For example:
>
> Select * From TablePerson Where (Age(Birthdate) > 20) and (Age(Birthdate) <
> 98)
>
> That would make it really easy.
>
> Things I have tried so far:
>
> Trail 1, SQL DateDiff function:
>
> DateDiff('yyyy', '31-12-1910', '6-1-2008' )
>
> This is no good, it returns age 98, the real age is 97.

Tried PERIOD_DIFF(x,y)/12 ?


--

//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация