Skip to content

Instantly share code, notes, and snippets.

@jblac
Created March 19, 2013 17:17
Show Gist options
  • Save jblac/5198089 to your computer and use it in GitHub Desktop.
Save jblac/5198089 to your computer and use it in GitHub Desktop.
SELECT a.id as id, DATE(a.startTime) AS startTime, DATE(a.endTime) AS endTime, a.startTime AS startTime1,
a.endTime AS endTime1, CONCAT(p.`first_name`, ' ', p.last_name) as `caseManager` FROM appointmentBlock a
JOIN `User` p ON p.id = a.`caseManager_id` WHERE a.startTime BETWEEN :start AND :end
GROUP BY a.startTime, a.caseManager_id
Array
(
[0] => Array
(
[id] => 1
[startTime] => 2013-03-18
[endTime] => 2013-03-18
[startTime1] => 2013-03-18 00:00:00
[endTime1] => 2013-03-18 23:59:00
[caseManager] => Jackson Dude
)
[1] => Array
(
[id] => 2
[startTime] => 2013-03-18
[endTime] => 2013-03-18
[startTime1] => 2013-03-18 07:00:00
[endTime1] => 2013-03-18 08:00:00
[caseManager] => Tiff Dude
)
[2] => Array
(
[id] => 9
[startTime] => 2013-03-19
[endTime] => 2013-03-19
[startTime1] => 2013-03-19 09:20:00
[endTime1] => 2013-03-19 10:20:00
[caseManager] => Tiff Dude
)
[3] => Array
(
[id] => 4
[startTime] => 2013-03-19
[endTime] => 2013-03-19
[startTime1] => 2013-03-19 14:08:00
[endTime1] => 2013-03-19 14:08:00
[caseManager] => Tiff Dude
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment