Viewing 15 posts - 16 through 30 (of 321 total)
--@tmp might be a killer without the right index
--dunno if in your design you have another table that keeps "status data" about machines like :
-- InstallationData
-- StartingModelNo
-- CurrentModelNo
--...
December 12, 2007 at 8:06 am
gova (12/11/2007)
It makes a lot of sense to have fixed period of time for analysis and charts. The way our all monthly reports run is for the month. I...
December 11, 2007 at 12:51 pm
--I don t understand what you mean by monthly ... you ll HAVE to use fixed period times to be able to do valid comparisation among period values (feb is...
December 11, 2007 at 11:03 am
--@t_from, @t_to are NOT used in the actual query. Their purpose was just to display the intermediate results
--when @pToModel or @pFromModel is missing all complaints before/after are calculated regardless of...
December 11, 2007 at 9:01 am
--added staff to handle variable no of weeks
DECLARE @NoOfWeeks INT
SET @NoOfWeeks=3
SELECT
CAST(DATEDIFF(day,B.DataDate-1,A.DataDate)/7 as INT)-1 as WeekNo,
SUM(Complaints) NoOFComplaints
FROM @CustomerComplaints A INNER JOIN
(--@t_from
SELECT MachineID,MAX(DataDate) DataDate
FROM @CustomerComplaints
WHERE Model=@pFromModel
GROUP BY MachineID
) B
ON A.MachineID=B.MachineID and...
December 11, 2007 at 8:31 am
--might wanna check the defined periods(dunno if they are right)
--Indexes! (add as needed)
SET NOCOUNT ON
DECLARE @pToModel varchar(16)
DECLARE @pFromModel varchar(16)
SET @pFromModel='Model 2'
SET @pToModel='Model 3'
DECLARE @t_from TABLE(MachineID VARCHAR(32),DataDate DATETIME)
DECLARE @t_to TABLE(MachineID VARCHAR(32),DataDate...
December 11, 2007 at 7:20 am
You lll need more clear specs
but this will return almost what you need(not finished since there is an error maybe in sample? ) :
DECLARE @pToModel varchar(16)
SET @pToModel='Model 3'
DECLARE @pToModelDate...
December 10, 2007 at 1:37 pm
The {CR} for end rows doesn t give and extra line.
The "extra line" is given by the {LF}
You can open the result file in a HEX editor and check the...
January 9, 2007 at 11:41 am
Try to change in your DTS package-->destination file-->Properties-->>Row Delimiter from {CR}{LF} to {CR}
January 9, 2007 at 10:07 am
exec @job_status = master..sp_MSget_jobstate @job--- here yoour variabile will not hold the "desired job_status" but the result of executing the stored procedure succesfully/unsuccessfully
DECLARE @job_id uniqueidentifier, @job_status int
SET @job_id = (select...
December 11, 2006 at 12:45 pm
DECLARE @T TABLE(MemberNbr varchar(11),StartDate int,
EndDate int,PlanCode varchar(3))
INSERT INTO @T
SELECT '12345678901', 20050101, 20050501, 'ABC'
UNION ALL SELECT '12345678901', 20050501, 20051231, 'BBB'
UNION ALL SELECT '12345678901', 20060401, 20060601, 'BBB'
--UNION ALL SELECT...
December 11, 2006 at 11:41 am
This might help : BO
SQL Mail and SQL Agent Mail sessions may be configured to use the same Windows NT...
November 29, 2006 at 2:33 pm
DECLARE @Table TABLE(pKey int,grp int, val int)
INSERT INTO @Table
SELECT 1,1,11 UNION ALL
SELECT 2,1,12 UNION ALL
SELECT 3,1,13 UNION ALL
SELECT 4,2,21 UNION ALL
SELECT 5,2,22 UNION ALL
SELECT 6,3,31 UNION ALL
SELECT 7,3,32 UNION ALL
SELECT...
November 24, 2006 at 12:19 pm
still... not the desired result
SET @customer='PELE'
SET @id_city=NULL
SET @id_country='Spain'
November 24, 2006 at 11:47 am
Viewing 15 posts - 16 through 30 (of 321 total)