Viewing 5 posts - 1 through 5 (of 5 total)
CASE when datediff(day,a.dteTeslimTarihi,b.OnayTarihi)>0 Then 2 else 0 end
March 19, 2008 at 2:51 am
This is my solution:
declare @A1 int
declare @i int
set @i=0
create table #result (A1 int ,A2 int,A3 varchar(100))
DECLARE cursorrr CURSOR FOR
select a1 from test order by newId()
OPEN cursorrr
FETCH NEXT...
February 4, 2008 at 8:41 am
that is my solution
select distinct s1.MIS,'only' + '-' + case when type=1 then 'medical' else 'therapy' end State
from #serv s1
where not exists (select 1 from #serv s2 where s1.MIS=s2.MIs and...
January 30, 2008 at 6:57 am
select t1.date,t1.store,t1.trans_number,t1.prod_number
,case when maxrandom=2 then 2 else random end as random
from Mytable t1
,(select date,store,trans_number,max(random) maxrandom from Mytable group by date,store,trans_number ) tempTable
where t1.date=tempTable.date and t1.store=tempTable.store and t1.trans_number=tempTable.trans_number
January 4, 2008 at 2:15 am
declare @Year int
declare @Month int
select @Year=datepart(year,getdate()),@Month=datepart(month,getdate())
declare @NextMonth int
if @Month<>12
set @NextMonth=@Month+1
else
set @NextMonth=1
select convert(datetime, convert(char(4),@Year)+right('0'+convert(varchar,@Month),2)+'01')FirstDay
,dateadd(d,-1,convert(datetime,convert(char(4),@Year)+right('0'+convert(varchar,@NextMonth),2)+'01'))LastDay
December 31, 2007 at 1:20 am
Viewing 5 posts - 1 through 5 (of 5 total)