我希望得到两个CenterMeeting之间的两个日期

时间:2016-09-16 09:29:51

标签: sql sql-server

var targetElement = document.querySelector('#container');
var observer = new MutationObserver(function(mutations) {
    mutations.forEach(function(mutation) {
        // perform the required actions here...
        console.log(mutation.type);
    });
});

observer.observe(targetElement, { attributes: true, childList: true, characterData: true });

1 个答案:

答案 0 :(得分:1)

在SQL Server中,您不能简单地将布尔比较作为when子句。

因此,请在when中包含条件并明确返回值:

(case when @mode = 'TwoDays' and
           CenterMeetingDay between datepart(dw, GETDATE() - 1) and DATEPART(DW, GETDATE() + 1) 
      then 1 else 0
 end) as CenterMeetingDay

where子句中,您可以执行以下操作:

where ( (@mode = 'TwoDays') and CenterMeetingDay between datepart(dw, GETDATE() - 1) and DATEPART(DW, GETDATE() + 1)) or
      ( (@mode <> 'TwoDays' . . . )

或:

where (case when @mode = 'TwoDays' and
                 CenterMeetingDay between datepart(dw, GETDATE() - 1) and DATEPART(DW, GETDATE() + 1) 
            then 1 else 0
       end) = 1