Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-05-13 : 07:00:52
|
| ALTER proc carrierTest --2008,8,7@pYear int, @pMonth int, @pDays int asbegindeclare @pOperator varchar(32)declare @pDay1 intdeclare @pDay2 intcreate table #temp5 (callyy int,Callmm int, Calldd int,Prefix varchar(50),Zone varchar(50),TimeCls varchar(15),Operatorout varchar(30),Talktime float,Cost float)set @pDay2 = convert(int, DATEPART(DAY,getdate()));set @pDay1 = @pDay2 - @pDays;DECLARE carname CURSORFOR select displayname from carrier_test open carnamefetch next from carname into @pOperatorwhile(@@fetch_status<>-1)begininsert into #temp5 exec carr_sum_Mar08_timediff_Datewise_withPrefix @pYear,@pMonth,@pDay1,@pDay2,@pOperatorfetch next from carname into @pOperatorendCLOSE carnameDEALLOCATE carnameselect * from #temp5drop table #temp5endset @pDay2 = convert(int, DATEPART(DAY,getdate()));set @pDay1 = @pDay2 - @pDays;i need logic for time also gmt timings send me logic |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-05-13 : 07:04:00
|
| >> i need logic for time also gmt timingsnot sure what you mean.Datepart returns an int so you don't need that convert.I take it you can't change the SP which is why you are looping.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-05-13 : 07:05:52
|
| dont know explain me |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-05-13 : 07:08:08
|
| Which time / timings are you talking about?convert(varchar(8),getdate(),108) maybe?==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-13 : 07:24:25
|
| use GETUTCDATE function instead of GETDATE() to get GMT times |
 |
|
|
|
|
|
|
|