Re: First and Last timestamp of the day/week / month

2010-04-22 Thread Alister West
You could rewrite it english friendly (5.1.37) SET @DAY_START = curdate(); SET @WEEK_START = curdate() - interval weekday(now()) DAY; SET @MONTH_START = date_format(curdate(), "%Y-%m-01"); ## DAY SELECT timestamp(@DAY_START) as min_ts, timestamp(@DAY_START + INTERVAL 1 DAY

First and Last timestamp of the day/week / month

2010-04-22 Thread Cantwell, Bryan
I need to be able to get a first and last timestamp for a day a week or a month. I have an example of what I did so far that gets me that info for a week... but I fear that it is far more complex than it needs to be. Anyone have a simple way to get first and last timestamp for these intervals? SEL