0

请帮助查找错误...

DECLARE @TDT DATETIME; SET @TDT ='20-AUG-2013 05:00:000 PM';
DECLARE @SSN INT; SET @SSN = 1;
set @SSN =case LTRIM(RIGHT(CONVERT(VARCHAR(20), @TDT, 100), 2)) when 'PM' then 1

错误显示...

Incorrect syntax near '1'.
4

1 回答 1

3

在语句中添加结尾

case LTRIM(RIGHT(CONVERT(VARCHAR(20), @TDT, 100), 2)) when 'PM' then 1 END
于 2013-09-01T10:38:39.917 回答