Home ยป My Weeks

My Weeks

!!! No Suite Owner Weeks data for Owner between 2022 and 2023! SQL=SELECT DISTINCT w.Year, u.Name AS suite, ouw.Week_Cd AS week, o.Entity AS owner, (SELECT start_dt FROM wp_mhihoa_weeks AS Wks1 WHERE Wks1.code = ouw.Week_cd AND Wks1.year=w.year AND Wks1.Week_Number = 1) AS week1, (SELECT start_dt FROM wp_mhihoa_weeks AS Wks2 WHERE Wks2.code = ouw.Week_cd AND Wks2.year=w.year AND Wks2.Week_Number = 2) AS week2, (SELECT start_dt FROM wp_mhihoa_weeks AS Wks3 WHERE Wks3.code = ouw.Week_cd AND Wks3.year=w.year AND Wks3.Week_Number = 3) AS week3, (SELECT start_dt FROM wp_mhihoa_weeks AS Wks4 WHERE Wks4.code = ouw.Week_cd AND Wks4.year=w.year AND Wks4.Week_Number = 4) AS week4, (SELECT start_dt FROM wp_mhihoa_weeks AS Wks5 WHERE Wks5.code = ouw.Week_cd AND Wks5.year=w.year AND Wks5.Week_Number = 5) AS week5 FROM wp_mhihoa_owner_unit_weeks ouw INNER JOIN wp_mhihoa_owner o ON ouw.owner_num = o.number AND o.id = (SELECT MAX(id) FROM wp_mhihoa_owner o2 WHERE o.Number=o2.Number) INNER JOIN wp_mhihoa_units u ON ouw.unit_num = u.number INNER JOIN wp_mhihoa_weeks w ON ouw.week_cd = w.code WHERE o.Discont_Dt = "" AND o.Number=%d AND w.year BETWEEN %d AND %d ORDER BY w.year, ouw.Week_Cd