|
Posted by Jim P on 01/06/08 09:02
Skybuck
believe me and others. there is a way to do this
and the vendors do not need to be informed. - -
you just need to take the time to think about it and
how it is typically done.
the fact that you do not know it - - - does not mean that a method does
not exist.
and the reason that you can not pass this on yourself and have to count
on the work and effort of others. - - - Is your copy of PHP legal?
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.
>
> Trail 2, Encoding min range and max range as TdateTime in Delphi.
>
> EncodeDate( 20, 0, 0 ); // failure, invalid year specified.
>
> I either need a solution in SQL or in Delphi.
>
> The only solution I can think of in Delphi is:
>
> Calculate the minimum birthday and maximum birthday, so then the question
> becomes:
>
> How to do that accurately ?
>
> Thanks for listening and any help,
>
> Bye,
> Skybuck.
>
> P.S.: alt.php.sql newsgroup included because maybe they know something about
> SQL and maybe somebody can pass this request onto database vendors ;) :) =D
>
>
Navigation:
[Reply to this message]
|