我想在一种情况下使用以下条件,我该怎么做
((LTRIM(RTRIM(AdvertisementAuthorityAfterDateOfPublication.AAADPPapCode)) = (LTRIM(RTRIM(@PapCode)))) AND
(DATEDIFF(DAY,(CONVERT(date,@PubDate,111)),(CONVERT(date,CURRENT_TIMESTAMP,111)))) > (AdvertisementAuthorityAfterDateOfPublication.AAADPAddNoOfDates)
AND
(LTRIM(RTRIM(AdvertisementAuthorityAfterDateOfPublication.AAADPSysOperator))) != (LTRIM(RTRIM(@UserName))))
我尝试以下方法,但出现错误
SELECT CASE
WHEN ((LTRIM(RTRIM(AdvertisementAuthorityAfterDateOfPublication.AAADPPapCode)) = (LTRIM(RTRIM(@PapCode))))
AND (DATEDIFF(DAY, (CONVERT(date, @PubDate, 111)), (CONVERT(date, CURRENT_TIMESTAMP, 111)))) > (AdvertisementAuthorityAfterDateOfPublication.AAADPAddNoOfDates)
AND (LTRIM(RTRIM(AdvertisementAuthorityAfterDateOfPublication.AAADPSysOperator))) != (LTRIM(RTRIM(@UserName))))
IS NULL THEN 1
AS ErrorTag;