Forum Replies Created

Viewing 15 posts - 151 through 165 (of 194 total)

  • RE: Aggregates sums in dimension level

    The simpler solution would be to add a column to the fact table as " YTD Sales"

  • RE: Aggregates sums in dimension level

    The simpler solution would be to add a column to the fact table as " YTD Sales"

  • RE: Use Results from a Cross Join for dynamic SQL

    I obviously missunderstood the question. If that is what you want just change the final query to this.

    Select C.PRODS, Count(Distinct resp )

    From

    #Combinations as c

    Left Join #Respondents as r

    on r.Combo...

  • RE: Use Results from a Cross Join for dynamic SQL

    The Idea Works you Are just not Querying the tables correctly

    Add this to the end of the script to do what you want:

    Select Count(Distinct resp )

    From

    #Combinations as c

    Left Join #Respondents...

  • RE: Use Results from a Cross Join for dynamic SQL

    AKShah1,

    There is an error in the code I sent you

    Here is the corrected code:

    Drop Table #ProdX

    Create Table #Prodx(

    Rid int identity(0, 1)

    ,ProdName Char(1)

    )

    --insert into prodx select ''

    insert into #prodx select 'A'

    insert...

  • RE: Insert data

    Try this:

    Drop Table #Temp0

    Create table #Temp0(

    DO_NO_ALPHA char (1),

    START_DO_RANGE int,

    END_DO_RANGE int

    )

    Insert into #Temp0 values('x', 1, 350)

    Insert into #Temp0 values('y', 1, 25)

    --=== using the method recently posted to get possibly numbers

    Drop table...

  • RE: Convert ASCII

    Not Entirely sure what you want but try this:

    It Will give you the ascii number represented by the hexadecimal number

    declare @s1 varchar(2)

    ,@ii int

    ,@bin varbinary(10)

    set @s1='14'

    set @bin = 0

    set @ii...

  • RE: Must declare the variable ...

    I believe you should be doing this:

    set @sql ='INSERT INTO ##all_logins SELECT name, ' + @server_name +' FROM ' + @sys_table + ' WHERE CONTAINS(name,''' + @user_name +...

  • RE: Use Results from a Cross Join for dynamic SQL

    Sorry gents. I seem to have left some coomment markers in the code.

    The top block is just to get Temporary table to work with.

  • RE: Use Results from a Cross Join for dynamic SQL

    Here's a completely different method. Some explanations may be needed, but some of you get the idea. Working out the cost of each Product combination should be easy.

    here...

  • RE: GROUING function

    The grouping tells you if the row is an aggregate using that column. Try using it in the pubs database, grouping by country, state, city, WITH CUBE to see...

  • RE: Transpose Table

    Yes it is. you would have to dynamically build the statement to get these results. I do not have a code example with me, sorry, but I have done...

  • RE: CHARINDEX returning 0 on long text field

    Use Patindex instead of charindex on text data columns

  • RE: CHARINDEX returning 0 on long text field

    Check BOL text datatype, "ntext, text and image" the list of usable functions on theses data types does not include charindex

  • RE: Dynamic Insert into

    I have not looked at this script in a few weeks so, of the top of my head,

    You will need to create Sampledb.

    Also script all the tables, with indexes,...

Viewing 15 posts - 151 through 165 (of 194 total)