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 : 06:02:24
|
| declare @cname varchar(30)create table #temp5 (callyy int,Callmm int, Calldd int,Prefix int,Zone varchar(50),TimeCls varchar(15),Operatorout varchar(30),Talktime float,Cost float)DECLARE carname CURSORFOR select displayname from carrier_test open carnamefetch next from carname into @cnamewhile(@@fetch_status<>-1)begininsert into #temp5 exec carr_sum_FEB08_timediff_PreviousMonth_Datewise_withPrefix_minus '2008','02','29','29',@cnamefetch next from carname into @cnameendCLOSE carnameDEALLOCATE carname for this sp i need write a logic before forloop to generate a report sysdate before 7 days and sysdate to before 15 days and sysdate to before i month |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-13 : 06:11:02
|
All you need is a tally table with prestored numbers or dates.Then you easily can fetch the records you want (-7 days, -15 days and so on). E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|