Forum Replies Created

Viewing 15 posts - 676 through 690 (of 1,156 total)

  • RE: Narrow down the recordset

    It looks like your insert into temp table worked successfully. Can you verify this by putting a select * from #temp after the insert.

    Also it might be benificial to...

  • RE: Newb needs help getting the sum of columns from multiple tables

    You could also union all the query results together like this:

    SELECT 'First',SUM(Table1.Column1) AS [Sum]

    FROM MainTable

    LEFT JOIN DataTable Table1

    ON MainTable.ID = Table1.ID AND Table1.Type = 'A'

    UNION ALL

    SELECT 'second',SUM(Table2.Column9) AS [SecondValue]

    FROM...

  • RE: Narrow down the recordset

    You can remove the row_id column as the solution you are using does not require it.

  • RE: Narrow down the recordset

    Check your procedure you may have your procedure variable not declared as varchar(max)

    Is this your stored procedure variable that you are passing conids into?

    if so you will need to bump...

  • RE: Narrow down the recordset

    Ok. Keep us posted.

  • RE: Narrow down the recordset

    Make sure that you are using the current version of the insert table.

    I edited my post and you may have missed it. All the new query does is join everybody...

  • RE: Concatenate numbers to form a 7 digit string

    Additionally, you have initialize the text string

    set @textNumber = ''

  • RE: Concatenate numbers to form a 7 digit string

    Int counter is not set to anything. Set it = to 1 or 0

    set @intcounter = 1

  • RE: Narrow down the recordset

    Declaring a table variable (@C) may lead to performance problems because all rows you insert will be stored in memory...

    Another good point Jonnie. Another thing to do is...

  • RE: Narrow down the recordset

    It looks like its returning what I want but it is way to slow. It took 50 second for one consultantID and 3.45 sec for two ConsultantIDs I can't even...

  • RE: Narrow down the recordset

    So, is the query working how you want it to?

    Additionally, you can remove the second filter from the actual query because you are filtering the data in the insert into...

  • RE: Case statement

    You did not give your case statement a column name: you have to either give it an input expression or name it.

    You have to change this:

    CASE

    When SalesProb = 0...

  • RE: Case statement

    Hi Adam,

    Out of interest, would a computed col be a bad implimentation for this problem?

    The answer depends on usuage really. Since this data is going to be used for...

  • RE: Case statement

    Sorry, I left out the alias. When you use a subquery in a from clause you must alias the query. This code should work for you.

    INSERT INTO ReportingData

    (ProjectNo

    ,...

  • RE: Case statement

    You cannot reference an aliased column in the same select statement. You have to use the case statement again or use a subquery for your from clause. I...

Viewing 15 posts - 676 through 690 (of 1,156 total)