RE: Max date in recordset

2006-11-14 Thread Jerry Schwartz
z Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 14, 2006 12:00 PM > To: mysql@lists.mysql.com > Subject: Re

RE: Max date in recordset

2006-11-14 Thread Jerry Schwartz
Assuming that insertdate is a DATE column, SELECT * FROM t WHERE t.insertdate = (SELECT MAX(t.insertdate) FROM t)); would do it. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > F

Re: Max date in recordset

2006-11-14 Thread Dan Buettner
If you're looking for the records from the last full day contained in the data, not the past 24 hours according to the clock, then this ought to work: select * from table where InsertDate >= date_sub( (select max(InsertDate from table),interval 1 day) order by InserDate desc Dan On 11/14/06, V

Re: Max date in recordset

2006-11-14 Thread Jo�o C�ndido de Souza Neto
select * from table where InsertDate = date_sub(now,interval 1 day) limit 3; Not tested, but i think it will work fine. ""Vittorio Zuccalà"" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > Hello, > i've a table with a lot of field and in particular: > "InsertDate","Box","Prt"