Re: more an SQL issue but I can't find any help
| From: | David Robley | Date: | Fri, 20 Apr 2001 02:30:41 +0000 |
| Subject: | Re: more an SQL issue but I can't find any help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49481@lists.php.net to get a copy of this message | ||
On Fri, 20 Apr 2001 11:35, Marian Vasile wrote:
> I have a table with users and their birthdates.
> I want to SELECT all the users who have more than 18 years. How I can
> do that using bisect years ? (february 28 days and 29 days)
>
> plz help ...
>
> Marian Vasile
> IT Manager
> Schnecker van Wyk & Pearson
> www.investments.ro
> +40 (0) 1 2309000
Leap years shouldn't be a problem? I don't know what DB you are using or
what format you store your dates - but if you can do a query something
like
SELECT * FROM table WHERE birthdate > (NOW()-18years)
using whatever your DB supports for the last bit :-) I _think_ it might
work as is with recent MySQL.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA