Forum Replies Created

Viewing 15 posts - 1,696 through 1,710 (of 2,007 total)

  • RE: IN Clause in SQL Query

    Probably an ambiguous column error.

  • RE: Conert Rows into columns

    WayneS (3/11/2011)


    For more complex pivoting (tracking multiple columns, dynamic), or for even a way that is normally a better performer, check out the two articles in my signature on Cross-Tabs...

  • RE: Conert Rows into columns

    Simple pivot example.

    DECLARE @table AS TABLE(Id INT, Product CHAR(5), TT INT, Week CHAR(2))

    INSERT INTO @table

    SELECT 1, 'Test1', 75, '1'

    UNION ALL SELECT 2, 'Test2', 20, '1'

    UNION ALL SELECT 3, 'Test1', 60,...

  • RE: Issue with time showing as fractional seconds.

    =Format(Fields!elapsedtime.Value, "HH:mm:ss")

    Note - This will only work if the elapsed time never goes above 23:59:59. If it does, there's another way that's a little more complicated.

  • RE: Number and date formatting options for hh:mm:ss

    Hmmm, strange. Never come across this issue before.

    This would solve the problem: -

    =floor((Fields!response_time.Value / 3600)) & ":" & floor(((Fields!response_time.Value Mod 3600) / 60)) & ":" & floor(((Fields!response_time.Value Mod 3600) Mod...

  • RE: Number and date formatting options for hh:mm:ss

    I'm unable to reproduce that result - can you let me know what the response_time.value was please?

  • RE: Getting part of file names

    I'd use a derived column, using something like this: -

    REVERSE(SUBSTRING(REVERSE(@[User::varFileName]),1,FINDSTRING(REVERSE(@[User::varFileName]),"_",1) - 1))

    That'll include the extension, so add another substring in there to remove it.

    After that, I'd have a conditional split...

  • RE: Adding Values To Column Based On Value of Other Columns On The Same Row

    Not tested, but how about a case statement?

    --Dummy table and data

    DECLARE @Samp AS TABLE (

    token INT, tokenorder SMALLINT, startdate SMALLDATETIME,

    enddate SMALLDATETIME, proc1 VARCHAR(6), proc2 VARCHAR(6),

    proc3 VARCHAR(6), proc4 VARCHAR(6), proc5 VARCHAR(6),

    proc6...

  • RE: Missing years as comma seperated list

    This doesn't add anything to ColdCoffee's answer. I just saw the other empty thread before I spotted this one so wrote out my solution (pretty much identical to ColdCoffee)

    --Create Dummy...

  • RE: Number and date formatting options for hh:mm:ss

    karen.blake (3/2/2011)


    I do have one other question. For 2 of the calls the response time is 223:52:54 (if you calculate it and states this in the system we are currently...

  • RE: Difference in tables columns

    SELECT a.Id, b.total

    From TableA a

    LEFT OUTER JOIN (SELECT b.Id, SUM(b.quantity) AS total FROM TableB b GROUP BY b.Id) b ON a.ID = b.Id

    where b.total>100

  • RE: The Oddest Interview Questions

    Michael Valentine Jones (2/23/2011)


    skcadavre (2/23/2011)


    "What do your parents do for a living?"

    I just remember thinking - what in god's name has that got to do with anything?

    It's good to have...

  • RE: Stored Procedure: IF...WHERE help

    Not looked at your "IF" statement at the end of the proc, but the SELECT statements can be concatenated using CASE statements.

    CREATE PROCEDURE [dbo].[Sp_ee_a_disabled]

    @inT1 VARCHAR(200), @inT2 VARCHAR(200), @inT3 VARCHAR(200)

    AS

    ...

  • RE: The Oddest Interview Questions

    "What do your parents do for a living?"

    I just remember thinking - what in god's name has that got to do with anything?

  • RE: finding occurences of select *

    Would this sort of thing be useful?

    SELECT Isnull(sp.name, sw.name), sm.object_id

    FROM sys.sql_modules sm

    LEFT OUTER JOIN sys.procedures sp ON sp.object_id = sm.object_id

    LEFT OUTER JOIN sys.VIEWS sw ON sw.object_id = sm.object_id

    WHERE (definition LIKE...

Viewing 15 posts - 1,696 through 1,710 (of 2,007 total)