Displaying 1 result from an estimated 1 matches for "monthweek".
Did you mean:
month_week
2007 Apr 09
1
help with ActiveRecord joins
...vents.*, library_dates.start_date
FROM
library_dates
LEFT OUTER JOIN events ON 1=1
WHERE events.id IN (SELECT event_id FROM recurrences WHERE
monthday IS NOT NULL AND DATEPART(dd, start_date) = monthday OR
(monthday IS NULL AND weekday IS NOT NULL AND DATEPART(dw, start_date)
= weekday AND
(monthweek IS NULL OR datepart(dd, start_date) BETWEEN
7*(monthweek-1) + 1 AND 7*(monthweek-1) + 7)
))
OR events.id IN (SELECT event_id FROM occurrences WHERE startdate =
start_date)
(the DATEPART function is sqlserver-specific, works like DAYOFWEEK() and
DAYOFMONTH() in mysql)
I''m wondering the...