You are here: Re: [PHP] Between Query (0T) « PHP « IT news, forums, messages
Re: [PHP] Between Query (0T)

Posted by Matthew Weier O'Phinney on 05/09/05 16:00

* andreja@beogradnet.com <andreja@beogradnet.com> :
> I am not sure
> but maybe something like this is posible
>
> $current_year = date(Y);
> $qry = "SELECT * FROM
> `table`
> WHERE ($current_year-YEAR(birthday)) BETWEEN 25 AND 26"


No -- because this incorrectly identifies somebody born on June 14 as 26
even though today is May 9, and they're still 25.


> "Matthew Weier O'Phinney" <matthew@garden.org> wrote in message
> news:slrnd7sdct.2h3.matthew@webmaster2.garden.org...
> > * Ryan A <ryan@coinpass.com> :
> > > Thanks for replying.
> > >
> > > > SELECT * FROM
> > > > `table`
> > > > WHERE `age` BETWEEN 25 AND 26;
> > >
> > > I knew the above, but how do i use it with my date field when i have
> > > birthdates like this:
> > > 01-01-1969
> > > and 03-05-1955

--
Matthew Weier O'Phinney | WEBSITES:
Webmaster and IT Specialist | http://www.garden.org
National Gardening Association | http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:matthew@garden.org | http://vermontbotanical.org

 

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

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