On Fri, 20 Apr 2001 17:02, you wrote:
> Yes but how I can "say" 18 years ???
>
> Marian Vasile
> IT Manager
> Schnecker van Wyk & Pearson
> www.investments.ro
> +40 (0) 1 2309000
>
> > -----Original Message-----
> > From: David Robley [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 20, 2001 5:31 AM
> > To: Marian Vasile; [EMAIL PROTECTED]
> > Subject: Re: [PHP] more an SQL issue but I can't find any help
> >
> > 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.

Well, it depends on your DB - for Mysql look for the date_sub or subdate 
functions; for anything else, you'll have to RTM :-0

-- 
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to