将Crystal Reports条件转换为SQL Server条件

时间:2014-01-07 18:28:33

标签: sql sql-server sql-server-2008-r2

我在将此Crystal Reports条件转换为SQL Server条件时遇到问题。

datefield >= iif(month(today)=1, minimum(LastYearYTD), minimum(YearToDate)) 

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

(datefield >= minimum(LastYearYTD) AND month(today)=1) 
OR 
(datefield >= minimum(YearToDate) AND month(today)<>1)