Re: Record Counting

2007-10-30 Thread ranjeet walunj
> > Neil Tompkins wrote: > > > I have a table of records all of which have a timestamp against them > > like 2007-10-25 10:10:19, and category like red, blue etc and a unique key. > > > > > > Using a SELECT statement is it possible to retrieve the count and number > > of records for each day e.g 20

Re: Record Counting

2007-10-27 Thread Ravi Kumar.
Sorry a correction SELECT DISTINCT LEFT(DATE_FIELD_NAME, 10), COLOR_FIELD_NAME, COUNT(T.*) AS CNT FROM TABLE_NAME T GROUP BY LEFT(DATE_FIELD_NAME, 10), COLOR_FIELD_NAME Ravi On 10/28/07, Peter Brawley <[EMAIL PROTECTED]> wrote: > > Neil, > > Do you mean ... > > SELECT DATE(datetimecol) AS da

Re: Record Counting

2007-10-27 Thread Peter Brawley
Neil, Do you mean ... SELECT DATE(datetimecol) AS date,colourcol,COUNT(*) FROM tbl GROUP BY date,colourcol; PB -- Neil Tompkins wrote: Hi, I have a table of records all of which have a timestamp against them like 2007-10-25 10:10:19, and category like red, blue etc and a unique key.

Re: Record Counting

2007-10-27 Thread Ravi Kumar.
Hi Neil, Try this: SELECT LEFT(DATE_FIELD_NAME, 10), COLOR_FIELD_NAME, COUNT(T.*) AS CNT FROM TABLE_NAME GROUP BY LEFT(DATE_FIELD_NAME, 10), COLOR_FIELD_NAME. Post the table structure if this does not help. Regards, Ravi On 10/27/07, Neil Tompkins <[EMAIL PROTECTED]> wrote: > > Hi, > > I have

Record Counting

2007-10-27 Thread Neil Tompkins
Hi, I have a table of records all of which have a timestamp against them like 2007-10-25 10:10:19, and category like red, blue etc and a unique key. Using a SELECT statement is it possible to retrieve the count and number of records for each day e.g 2007-10-25 for all red, and all blue etc