From: Date: July 29 2005 4:10pm Subject: Re: MAX select problem List-Archive: http://lists.mysql.com/mysql/187084 Message-Id: <42EA38EE.1090203@spill.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Lee Denny wrote: > Hello, > > I'm trying to get the date and amount of the most visits to my site over a > given time period using : > > SELECT max(visits) as maximum FROM visit WHERE (((visit_date >= > '$sdatestring') and (visit_date < '$edatestring')) and (site_id=$site_id)) > > This gives me the right figure, but when I try to pull out the date that > this occured on with, SELECT * FROM visit WHERE (((visit_date >= '$sdatestring') and (visit_date < '$edatestring')) and (site_id=$site_id)) ORDER BY visits DESC LIMIT 1; Regards, Jigal.