I have a column named TimeSlots
that holds a twelve hour range of dates, 7:00:00
thru 19:00:00
.
(我有一个名为列TimeSlots
保存日期的十二时段范围, 7:00:00
直通19:00:00
。)
I have a stored procedure that accepts a varchar
parameter that could be 'AM' or 'PM'.
(我有一个存储过程,该存储过程接受可以为'AM'或'PM'的varchar
参数。)
I am using a CASE expression inside the WHERE to get either: (我在WHERE中使用CASE表达式来获取以下任一信息:)
It ain't working.
(它没有用。)
Following is the example that i tried: (以下是我尝试的示例:)
AND [TimeSlot] = CASE WHEN @ApptTime = 'AM' THEN [TimeSlot] < '12:00:00'
WHEN @ApptTime = 'PM' THEN [TimeSlot] >= '12:00:00'
How can this be done?
(如何才能做到这一点?)
ask by StanB13 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…