a guest Dec 7th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- WHEN oh.DayOfWeek = 7 THEN DATEDIFF(minute, 0, oh.OpeningTime)
- ELSE DATEDIFF(minute, 0, oh.OpeningTime) + (1440 * oh.DayOfWeek)
- END AS OpeningTimeAsOffset,
- WHEN oh.DayOfWeek = 7 THEN DATEDIFF(minute, 0, oh.ClosingTime)
- ELSE DATEDIFF(minute, 0, oh.ClosingTime) + (1440 * oh.DayOfWeek)
- END AS ClosingTimeAsOffset,
- FROM [choices].[Organisation] o
- INNER JOIN choices.OpeningHours oh ON o.[OrganisationID] = oh.[OrganisationID]
- INNER JOIN choices.OpeningHoursType oht ON oht.OpeningHoursTypeID = oh.OpeningHoursTypeID
- WHERE o.OrganisationTypeID = 'PHA'
RAW Paste Data