salix/print/templates/email/osticket-report/sql/dateRange.sql

8 lines
447 B
MySQL
Raw Normal View History

2021-04-27 08:29:09 +00:00
SELECT @lastWeekMondayTime AS started, @lastWeekFridayTime AS ended
FROM (
SELECT @lastWeek := DATE_ADD(CURDATE(), INTERVAL -1 WEEK),
@lastWeekMonday := DATE_ADD(@lastWeek, INTERVAL (-WEEKDAY(@lastWeek)) DAY),
@lastWeekFriday := DATE_ADD(@lastWeekMonday, INTERVAL (+6) DAY),
2021-06-07 05:32:07 +00:00
@lastWeekMondayTime := CONCAT(@lastWeekMonday, ' 00:00:00'),
@lastWeekFridayTime := CONCAT(@lastWeekFriday, ' 23:59:59')
2021-04-27 08:29:09 +00:00
) t