Forum Replies Created

Viewing 15 posts - 1,201 through 1,215 (of 2,007 total)

  • RE: Today's Random Word!

    L' Eomot InversΓ© (12/8/2011)


    Obviously not enough. You didn't notice the bug in that code πŸ˜€ - on Christmas morning it only gives the correct (0) answer for the couple...

  • RE: Modulo operator problem

    Sorry, lost track of this thread.

    It sounds like what you want to do should be possible in one query. Can you provide me with expected result from the sample data...

  • RE: Return as single comma delimitted value

    Ninja's_RGR'us (12/8/2011)


    Cadavre (12/8/2011)


    Here's a FOR XML PATH version.

    SELECT STUFF((SELECT ',' + newRow

    FROM (SELECT CONVERT(VARCHAR(4),newRow) AS newRow

    ...

  • RE: Today's Random Word!

    Daniel Bowlin (12/7/2011)


    SELECT DATEDIFF(dd,GetDate(),'12/25/11') AS DaysTillChristmas

    Just to over-complicate matters . . . πŸ˜€

    SELECT CASE WHEN GETDATE() > DATEADD(d, 24, DATEADD(m, 11, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0)))

    ...

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (12/8/2011)


    Hmmm. When I click on the Forums link on the homepage, I get the maintenance page.

    (http://www.sqlservercentral.com/Forums)

    However, the link http://www.sqlservercentral.com/forums - with a lower f - works.

    The forums themselves...

  • RE: Return as single comma delimitted value

    Here's a FOR XML PATH version.

    SELECT STUFF((SELECT ',' + newRow

    FROM (SELECT CONVERT(VARCHAR(4),newRow) AS newRow

    ...

  • RE: Temp Table Vs Table Variable

    Dev (12/7/2011)


    Cadavre (12/7/2011)


    Dev (12/7/2011)


    Welcome to the discussion!

    But that statement is for a table with 2 rows. πŸ˜€

    The number of rows is irrelevant, the statement is...

  • RE: Temp Table Vs Table Variable

    Dev (12/7/2011)


    Welcome to the discussion!

    But that statement is for a table with 2 rows. πŸ˜€

    The number of rows is irrelevant, the statement is incorrect.

  • RE: Temp Table Vs Table Variable

    Dev (12/7/2011)


    And that's precisely my point. Plus, it can cache complete table in memory.

    OH FOR THE LOVE OF . . . . !

    I've had that argument so...

  • RE: Query Problem when Updating temporary table

    You're going about it wrong.

    Try this

    BEGIN TRAN

    --Sample data

    SELECT ItemId, MarketPriceSource, StartDate, EndDate, CollectGoods, W_house

    INTO #tmpOutput

    FROM (SELECT 'P12000', 'Missing', '2012-05-01', '2012-05-31', 0, 'CUP'

    UNION ALL SELECT...

  • RE: Adding a new column issue?

    david.ostrander (12/7/2011)


    SELECT r.name as Resource_Name,rw.name as Business_Unit,t.name

    FROM Resources r WITH(NOLOCK)

    INNER JOIN Workgroupmember wgm WITH(NOLOCK) ON wgm.ResourceID = R.ResourceID and wgm.historical = 0

    INNER JOIN Workgroup rw WITH(NOLOCK) ON rw.workgroupid =...

  • RE: Advnaced Grouping Help Needed

    Not sure I understand what you're after. Try these two queries to see if they help.

    BEGIN TRAN

    --Sample Data

    SELECT RowID, Color, Salesman

    INTO #sales

    FROM (SELECT 1, 'blue', 'bob'

    ...

  • RE: Modulo operator problem

    drew.allen (12/6/2011)


    Cadavre (12/6/2011)


    For your own sanity, or that of whoever has to maintain this monster, try this instead: -

    I would go even further. For your own sanity, your whole...

  • RE: Are the posted questions getting worse?

    Steve Jones - SSC Editor (12/6/2011)


    give up.

    Prolonging or repeating yourself doesn't help, and it ultimately clutters the thread up with arguments or nonsense. Ask once, repeat, then move on. You...

  • RE: Modulo operator problem

    For your own sanity, or that of whoever has to maintain this monster, try this instead: -

    SELECT id, dateFormula - (yearFormula+monthFormula) AS totaldays,

    (dateFormula - (yearFormula+monthFormula)) % 2 AS premod

    FROM (SELECT...

Viewing 15 posts - 1,201 through 1,215 (of 2,007 total)