Forum Replies Created

Viewing 15 posts - 16 through 30 (of 321 total)

  • RE: SQL crosstab query for Differential dates

    --@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

    --...

  • RE: SQL crosstab query for Differential dates

    gova (12/11/2007)


    Thanks Vasc.

    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...

  • RE: SQL crosstab query for Differential dates

    --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...

  • RE: SQL crosstab query for Differential dates

    --@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...

  • RE: SQL crosstab query for Differential dates

    --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...

  • RE: SQL crosstab query for Differential dates

    --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...

  • RE: SQL crosstab query for Differential dates

    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...

  • RE: DTS adds extra blank line to Text File

    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...

  • RE: DTS adds extra blank line to Text File

    Try to change in your DTS package-->destination file-->Properties-->>Row Delimiter from {CR}{LF} to {CR}

  • RE: Question/Problem re: sp_MSget_jobstate

    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...

  • RE: SQL HELP NEEDED

    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...

  • RE: MAPI Error 237 Problem

    This might help : BO

    Configuring Mail Profiles

    Sharing a Profile with SQL Mail

    SQL Mail and SQL Agent Mail sessions may be configured to use the same Windows NT...

  • RE: Inserting Blank Lines as Value Changes

    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...

  • RE: help on query

    still... not the desired result

     

    SET @customer='PELE'

    SET @id_city=NULL

    SET @id_country='Spain'

Viewing 15 posts - 16 through 30 (of 321 total)