实际中用到的SQL: select * from (select top 3 Id, case when startSignup>GETDATE() then '敬请期待' when (startSignup<GETDATE() and endsignUp>=getdate()) then '正在报名' when (StartDate<GETDATE() and EndDate>=GETDATE())or (StartDate<GETDATE() and EndDa
获取制定日期区间 declare @d as date declare @d2 as date set @d = '2014-06-03' set @d2 ='2014-06-10' select convert(varchar(10),dateadd(dd,number,@d)) as dt ,dateadd(dd,-1,convert(varchar(8),dateadd(mm,1,@d),120)+'01') from master..spt_values where type='P' a
1 select 2 --case (isnumeric(CMF_No)) when 1 then Convert(decimal(18,0),CMF_No) 3 --else Convert(nvarchar(255),CMF_No) end as CMF_No,Disti_Name, 4 --case (isnumeric(Disti_Invoice_Num)) when 1 then Convert(decimal(18,0),Disti_Invoice_Num) else 'sss' e