日期:2014-05-17 浏览次数:20470 次
Declare @CfTx int,@Date Datetime,@CfCxStr varchar(50)
Set @Date=Convert(Varchar(10),GetDate(),120)
set @CfTx=1
set @CfCxStr=''
if @CfTx=1
set @CfCxStr= and @Date<>LastJxDate
select * from CkInfo where ShenHe=1 +@CfCxStr+ and day(BeginDate)=day(@Date))
Declare @CfTx int,@Date Datetime, @CfCxStr varchar(50)
declare @sql nvarchar(max)
Set @Date=Convert(Varchar(10),GetDate(),120)
set @CfTx=1
set @CfCxStr=''
if @CfTx=1 set @CfCxStr=' and @Date<>LastJxDate'
set @sql='select * from CkInfo where ShenHe=1' + @CfCxStr + ' and day(BeginDate)=day(@Date)'
execute sp_executesql @sql,N'@Date Datetime',@Date=@Date
Declare @CfTx int,@Date Datetime,@CfCxStr varchar(50)
Set @Date=Convert(Varchar(10),GetDate(),120)
set @CfTx=1
set @CfCxStr=''
if @CfTx=1
set @CfCxStr= ' and @Date<>LastJxDate '
set @CfCxStr='select * from CkInfo where ShenHe=1' +@CfCxStr+ 'and day(BeginDate)=day('+@Date+'))'
exec(@CfCxStr)