Forum Replies Created

Viewing 15 posts - 91 through 105 (of 259 total)

  • RE: Creating matrix via TSQL

    In the #ActivitySummary there is a sort column ActivitySort which puts them in the appropriate Order so but how do I get the #Activity table joined sinced there is not...

  • RE: Creating matrix via TSQL

    I am not sure that gets me to where I want to be.

    This almost gets me to where I want to be:

    GO

    Declare @MonthsOut int, @StartDate datetime, @EndDate datetime, @COnsultantID char(20)

    Set...

  • RE: Creating matrix via TSQL

    Thanks for that It gave me an idea on how to pull the totals I am looking for but now I need to join in my temp table #ActivitySummary:

    DECLARE @consultantID...

  • RE: Creating matrix via TSQL

    With a some research into a solution what I think i need is a crosstab query. I started on some code but need some assistance:

    DECLARE @consultantID VARCHAR(20)

    DECLARE @StartDt DateTime

    DECLARE...

  • RE: Inserting a Row into a recordset

    Maybe this needs to be a new thread. Rules have changed and now I need to create a matrix so I thank everybody for their help. I did get the...

  • RE: Inserting a Row into a recordset

    But if I use the union statem to append my temp table that has only periodenddates won't that just add all the the periodenddated from the temp table regardless if...

  • RE: Inserting a Row into a recordset

    Well this is sort on the same lines:

    I have the following recordset:

    ConsultantID Mthly1stLinePORSales ...

  • RE: SUM Question

    You were right. I took out the PeriodEndDate and it summed correctly.

  • RE: SUM Question

    I tried to remove the periodenddate from the GROUP By but I get this error:

    Msg 8120, Level 16, State 1, Line 163

    Column 'Volume.PeriodEndDate' is invalid in the select list because...

  • RE: Inserting a Row into a recordset

    This is the solution iI implemented:

    ,Ord.ShipToFirstName + ' ' +Ord.ShipToLastName AS ShipToName

    ,ISNULL(Ord.ShippingTotal,0)

    ,ISNULL(Ord.OrderTotal,0)

    ,ISNULL(Ord.TaxTotal,0)

    FROM(SELECTDISTINCT con.[ConsultantID]

    ,Con.FirstName + ' ' + Con.LastName AS ConsultantName

    ,List.ListType

    FROM[Consultant] AS Con With (NoLock)

    ,(SELECT DISTINCT ListType FROM [SharedDimension].dbo.[DimListingType] With...

  • RE: Case statement not workin

    Simple is best I used this route:

    ,CASE

    WHEN v.PurchaseAmount/15000 <=1 THEN 0

    ELSE v.PurchaseAmount/15000

    END as 'TotalPersonalSalesCalculatedPoints'

  • RE: Case statement not workin

    Revisiting the spec it is any thing less than 1 (whole Number) that they want to see a 0.

  • RE: Case statement not workin

    I think the issue resolved it self when perople reminded me that 0.23220 is not equivlent to 0.

    THis is my solution:

    ,CASE

    WHEN v.PurchaseAmount/15000 <=1 THEN 0

    ELSE v.PurchaseAmount/15000

    END as 'TotalPersonalSalesCalculatedPoints'

  • RE: Case statement not workin

    Still works. same resultset.

  • RE: Case statement not workin

    Yes it worked. Kinda of hard to read the output.

    0000344 37127.3341821.8629992.62129.65108941.812007-11-30 00:00:00.000

    0000344 25964.2330203.9325797.920.0081966.082007-12-31 00:00:00.000

    0000344 14517.5418325.423914.60106.8436757.562008-01-31...

Viewing 15 posts - 91 through 105 (of 259 total)