hessodreamy
Programmer
I pull out a lot of reports for weekly figures, but is there any way to get the start date for a particulr week number?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT from_unixtime(uts,'%u') as week_number, count(*) as orders from ordersTable WHERE from_unixtime(uts,'%Y')=2006
GROUP BY from_unixtime(uts,'%u')
SELECT from_unixtime(uts,'%u') as week_number
, [COLOR=blue]from_unixtime(uts -
mod(from_unixtime(uts,'%w')+6,7)
*86400) as start_of_week [/color]
, count(*) as orders
from ordersTable
WHERE from_unixtime(uts,'%Y')=2006
GROUP
BY from_unixtime(uts,'%u')
, [COLOR=blue]from_unixtime(uts -
mod(from_unixtime(uts,'%w')+6,7)
*86400) [/color]