Re: select all events from (today-N) days

2006-04-10 Thread Ravi Malghan
Joerg: thank you. That worked and much faster too. WHERE EVENT_DATA.utime > UNIX_TIMESTAMP(SUBDATE(CURDATE(), 5)) AND EVENT_DATA.utime < UNIX_TIMESTAMP(SUBDATE(CURDATE(), 4)) Ravi --- Joerg Bruehe <[EMAIL PROTECTED]> wrote: > Hi Ravi, all, > > > Ravi Malghan wrote: > > Joerg: are you saying I

Re: select all events from (today-N) days

2006-04-10 Thread Shawn Green
--- Ravi Malghan <[EMAIL PROTECTED]> wrote: > Joerg: are you saying I need to compute the start time > and end time in epoch values and use it in > select count(*) from EVENT_DATA > where utime > start_time and utime < end_time ? > > Can you provide some pointers and what to search on. I > h

Re: select all events from (today-N) days

2006-04-10 Thread Joerg Bruehe
Hi Ravi, all, Ravi Malghan wrote: Joerg: are you saying I need to compute the start time and end time in epoch values and use it in select count(*) from EVENT_DATA where utime > start_time and utime < end_time ? "need to"? This is not required in order for the command to work (at all), b

Re: select all events from (today-N) days

2006-04-10 Thread Ravi Malghan
Joerg: are you saying I need to compute the start time and end time in epoch values and use it in select count(*) from EVENT_DATA where utime > start_time and utime < end_time ? Can you provide some pointers and what to search on. I have searched and can't seem to find any leads on how to get t

Re: select all events from (today-N) days

2006-04-07 Thread Joerg Bruehe
Hi Ravi, all! Ravi Malghan wrote: Ok. I found something. But wondering if this is most efficient Events for yesterday: select count(*) from EVENT_DATA where FROM_UNIXTIME(utime,'%Y-%m-%d') = (CURDATE() - INTERVAL 1 DAY); Events for last week select count(*) from EVENT_DATA where FROM_UNIXTIME(

Re: select all events from (today-N) days

2006-04-06 Thread Ravi Malghan
Ok. I found something. But wondering if this is most efficient Events for yesterday: select count(*) from EVENT_DATA where FROM_UNIXTIME(utime,'%Y-%m-%d') = (CURDATE() - INTERVAL 1 DAY); Events for last week select count(*) from EVENT_DATA where FROM_UNIXTIME(utime,'%U') = (DATE_FORMAT(CURDATE(),'

select all events from (today-N) days

2006-04-06 Thread Ravi Malghan
Hi: I have a date/time field (utime) which has unix time in epoch time. I want to select events from yesterday and another statement for all events from previous week. I have tried the functions listed at http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html. But I either get a synta