User Profile

Collapse

Profile Sidebar

Collapse
chrisstuart
chrisstuart
Last Activity: Mar 19 '08, 10:29 AM
Joined: Jan 14 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • chrisstuart
    replied to Maybe something very easy?
    Hi Delerma

    Thanks for the reply, Is this query still going to work for a dataset of records. I need for lines x to y to be minus-ed from the previous months lines x to y?
    Just looking at the code it seems that you are saying that it is just this month's 1 line minus last month's 1 line?...
    See more | Go to post

    Leave a comment:


  • chrisstuart
    replied to Maybe something very easy?
    Hi, let me try and give all the details, but what I really want is to subtract a dataset (dataset, i.e. line 129 to line 150, for month 11, columns 1 to 12)
    from the previous months dataset (i.e. month 10)

    Example
    Line Month Column1 Column2 Column3 Column99
    129 11 9,700 4,000 4,600 6,300
    130 11 7,800 8,300 1,500 3,900
    131 11 4,400 4,500 6,000 7,100
    132 11 500 8,600...
    See more | Go to post

    Leave a comment:


  • Thanks for the help, I sort off thought that the only solution would be to use dymanic SQL.

    Regards
    Chris
    See more | Go to post

    Leave a comment:


  • using a variable in the column_alias of a select

    Is there a way of doing the following

    DECLARE @1 AS VARCHAR(200)
    SET @1 = (SELECT COLDESC FROM DIM_ROWCOL_NEW WHERE COLNR = 1 AND ROWNR = 129)

    SELECT COL1 as @1, ....

    I dont want to set the column_alias to a set value, but rather select what ever is in the lookup table (Dim_rowCol_New ).

    Any ideas on this will help

    Thanks
    See more | Go to post

  • chrisstuart
    replied to Maybe something very easy?
    It would basically be a table with the structure

    [#Year] char(4),
    [#MonthNr] char(2),
    [#RowNr] decimal(3, 0),
    [#Column01] decimal(20, 4),
    [#Column02] decimal(20, 4) ,
    .....
    .....
    .....


    With data for MonthNr 1 to 12 for the year.
    i.e.
    "2007", "10", 129, 1234.00, 4321.00
    "2007", "11",...
    See more | Go to post

    Leave a comment:


  • chrisstuart
    started a topic Maybe something very easy?

    Maybe something very easy?

    Hi

    I've got a table with the following
    MonthNr
    ColumnNr
    RowNr
    Column01
    ......
    Column12

    I want to calc the movements between this month and last month
    Can this be done in 1 sql statement?
    I want to select * from table where monthnr = 11 and rownr between 1 and 10
    "minus" select * from table where monthnr = 10 and rownr between 1...
    See more | Go to post
No activity results to display
Show More
Working...