Need to get report with perameters only in excel 2003 with store procedure
Hi to all,
I have a store procedure whose out put, presently taking from sql and then copied data with headers in Excel 2003,
when ever i try to get data from pivot table it generate error that this kind of parameters could not be added,
due to licence problem i have to used excel 2003 not other tools so any body can help in this regard,
that i can get output in excel 2003,
is any vb tool i can get data in excel with date input function
my store procedure is as follows
______________________________________________________________
ALTER PROCEDURE [dbo].[sp_7_Total_1_shift_Output_ProductionRaw]
(
@ShiftDate Datetime,
@Shift_A_B_C_or_D_Please_Write_Shift_for_Refernce Char(1)
)
AS
SET NOCOUNT ON;
Declare @date1 datetime
Declare @date2 datetime
Declare @date3 datetime
Declare @date4 datetime
Declare @date5 datetime
Declare @date6 datetime
Declare @date7 datetime
Declare @date8 datetime
set @date1 = CONVERT(Datetime, @ShiftDate+'06:00:00', 102)
set @date2 = CONVERT(Datetime, @ShiftDate+'18:00:00', 102)
set @date3 = DATEADD(day,+1,(CONVERT(Datetime, @ShiftDate+'06:00:00', 102)))
set @date4 = DATEADD(day,+1,(CONVERT(Datetime, @ShiftDate+'18:00:00', 102)))
set @date5 = DATEADD(day,+2,(CONVERT(Datetime, @ShiftDate+'18:00:00', 102)))
set @date6 = DATEADD(day,+3,(CONVERT(Datetime, @ShiftDate+'06:00:00', 102)))
set @date7 = DATEADD(day,+3,(CONVERT(Datetime, @ShiftDate+'18:00:00', 102)))
set @date8 = DATEADD(day,+4,(CONVERT(Datetime, @ShiftDate+'06:00:00', 102)))
SELECT TOP (100) PERCENT COUNT(*) AS Quantity, dbo.Itemss.Type, dbo.ItemTBL.RoomID,
dbo.GetLineLU(RoomID)As LineID, dbo.GetDayDate(dbo.ItemTBL.Datestamp) As "Day_Date",
dbo.GetMonth(dbo.ItemTBL.Datestamp) As "Month" , dbo.GetDNMY(dbo.ItemTBL.Datestamp) AS "Date|D/N"
FROM dbo.ItemTBL INNER JOIN
dbo.Itemss ON dbo.ItemTBL.JobNum = dbo.Itemss.JobNum
WHERE
( dbo.ItemTBL.Datestamp between @date1 and @date2
or
dbo.ItemTBL.Datestamp between @date3 and @date4
or
dbo.ItemTBL.Datestamp between @date5 and @date6
or
dbo.ItemTBL.Datestamp between @date7 and @date8
)
GROUP BY dbo.ItemTBL.RoomID,dbo.GetLineLU(RoomID), dbo.Itemss.Type, dbo.GetDNMY(dbo.ItemTBL.Datestamp),dbo.GetDayDate(dbo.ItemTBL.Datestamp)
,dbo.GetMonth(dbo.ItemTBL.Datestamp)
HAVING (dbo.ItemTBL.RoomID BETWEEN 1 AND 16)
Order by CAST(dbo.GetMonth(dbo.ItemTBL.Datestamp) as int), CAST(dbo.GetDayDate(dbo.ItemTBL.Datestamp) as int),
dbo.ItemTBL.RoomID
________________________________________________________________________________________________________
thanks in advance with proper answer.
eric
November 9th, 2010 5:30pm
Hi Eric,
Your report is based on excel. However, this is reporting services forum. So, i would suggest you put your requestion in excel forum. On my SQL Server experiences, if you want to export the sql query result to Excel, the SSIS is good tool to
statify your requirement.
thanks,
Jerry
Free Windows Admin Tool Kit Click here and download it now
November 14th, 2010 8:38pm
thanks jerry for reply
I am already using this tool to get report SSIS tools and some time exporting to pdf and some time for excel which is really a good tool, i was thinking may be some body has such an code which can do this job by clicking on Excell file and just change the
datetime perameter and Shift and it will fetch data for me, i have already talk with one of my fellow who is using VB6 get data and exporting to Excell as we also have VB6 Licence, so now thinking to do this but my aim was to change datet in Excell box set
as perameter input and give out put in Excel 2003 as we have problem of only we have licence of Excell 2003 not upper version.
thanks any way for suggestion.
eric
November 15th, 2010 5:34am