日期:2014-05-18  浏览次数:20484 次

结果集中的日期字段+另一个字段


SELECT PID,CustID,ActionMan,Owner,ActionType,ActionDate,IsDelay,IsExec,DateAdd(day,IsDelay,ActionDate) AS NewCol FROM sTB WHERE ActionDate<'2012-4-17'


现在我想要用新的列 NewCol,当条件判断,这个日期是不是在范围内,却不行,提示列名无效。这个能用 SELECT 语句解决这个问题不?求高手指点。谢谢

------解决方案--------------------
select ...
from ...
where dateadd(dd,20,ActionDate) = '2012-04-14'