mysql week range
Posted: Thu May 10, 2007 9:11 pm
i was able to see a code somewhere and i was able to make a range of a week, for example, may 11 - may17, that is the range of the week(by the way, the sql query starts sunday as the first day of the week)...i was able to do it, however, all the records of that day reflects, for example, if i have 20 posts in 1 day, all the records are also posted and the range is reflected, what i wanted to do is that, if i have a record on a specific date even if it is 20 records, i dont want to retrieve all the records of those 20 and just get the date...i may sound confusing, here's my code by the way.
thank you very much 
Code: Select all
SELECT distinct date_format(l.date, '%V') as weekno, date_format(l.date, '%X%V') as fixed_week_num, date_add(l.date, interval 0 DAY) as ws, date_add(l.date, interval 6 DAY) as we FROM LoadLog l ORDER BY date_format(l.date, '%X %V')