Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)

  • RE: Recursive Query

    rupex2101 (4/17/2012)


    Try this...

    SELECT t1.PlanAccountKey, CASE t1.STRT_DATE WHEN t2.END_DATE THEN 'TRUE' ELSE 'FALSE' END AS op

    FROM @tblPlanAccount t1

    INNER JOIN @tblPlanAccount t2

    ON t1.PlanAccountKey = t2.PlanAccountKey-1

    But if PlanAccountKey has gaps then Mike's solution...

  • RE: Recursive Query

    Try this...

    SELECT t1.PlanAccountKey, CASE t1.STRT_DATE WHEN t2.END_DATE THEN 'TRUE' ELSE 'FALSE' END AS op

    FROM @tblPlanAccount t1

    INNER JOIN @tblPlanAccount t2

    ON t1.PlanAccountKey = t2.PlanAccountKey-1

  • RE: Summing group field

    I think this should be okay...

    =Sum(First(Fields!budget.value, "CompanyLevelGroupName"))

  • RE: BETWEEN ages

    if(@var1 > @var2) SELECT @var1 = @var2, @var2 = @var1

    should work too.

  • RE: BETWEEN ages

    Try this ...

    DECLARE @var1 INT, @var2 INT

    SET @var1 = 25

    SET @var2 = 28

    IF (@var1 > @var2)

    BEGIN

    SET @var2 = @var1 - @var2

    ...

  • RE: Function to set start and end date @variables

    Wildcat is right, just use 2 OUTPUT parameters instead of table.

  • RE: Refactoring an SP - stuck on a query

    this should work fine...

    SELECT UPPER(os.cpt4_id)

    FROM #TRANS t

    CROSS APPLY ( SELECT TOP 1 cpt4_id

    ...

Viewing 7 posts - 1 through 7 (of 7 total)