Reply to Re: SQL statement - date

Your name:

Reply:


Posted by Kyriacos Sakkas on 04/06/05 11:18

Jacques wrote:
> How should I formulate my sql statement to create a result set of members
> who registered between now and 7 days ago?
>
> I have tried the following and it is obviously incorrect:
>
> $sqlnewmembers = "Select uid, uprofilename from tblusers where udatereg
> between (date() and date() - 7)";
>
> Regards
>
> Jacques


this should work (please adjust date format to your needs):
BETWEEN
date('Y-m-d') AND date('Y-m-d',mktime(0, 0, 0, date("m"),
date("d")-7,date("Y")))";

Regards Kyriacos

[Back to original 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

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