Forum Replies Created

Viewing 15 posts - 466 through 480 (of 1,473 total)

  • RE: Help with advanced SELECT

    Words cannot express how glad I am I don't have to deal with names like that! =) How about something like this?

    SELECT INID, SUM(SumaAkcjiDeponowanych * CASE WHEN TransakcjePapieryWartoscioweTypTransakcji IN...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: pivot query help

    You basically need to use dynamic SQL to generate the columns for the pivot. Jeff wrote an article on it here:

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Filter not workinng as required

    You are much more likely to get an answer to this if you provide sample data and expected results. The article in my signature explains how to do this...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Trying to not use Cursors - Eliminating Duplicates

    Thanks for providing your code. However, if you could provide sample data and the results you would like to get (see the link in my signature on how to...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: compare data in two tables of different databases

    Different databases isn't really an obstacle, you just need to provide the database name as part of the object name. For example, say you have DatabaseA and DatabaseB.

    All you...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: More recent rows by user

    It looked to me like it would have to rescan the table for each row in the table for that WHERE clause. I may have misread the execution plan,...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Parsing sections of a string

    Are the number of '\'s always the same either to the right or the left of the data you need?

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: With Nolock

    (NOLOCK) allows dirty reads. Basically, there is a chance that if you are reading data out of the table while it is in the process of being updated, you...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Parsing sections of a string

    It depends. Can you post some more examples? Also, why did you get rid of the \837\? How did you know to do that? Basically it...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Rowcount for subset of data in temp table

    My pleasure. Let us know if you need any help adapting to the new requirements.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Multi/Nested CONVERT's

    Jeff Moden (10/20/2009)


    Heh... gettin' old... Seth beat me. Same idea though...

    SELECT DATEADD(ss,1,DATEADD(mm,DATEDIFF(mm,-16,GETDATE())-1,-16))

    That's OK, yours was better. I was just in the car thinking about all the extra ADD's...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Rowcount for subset of data in temp table

    Did you get this all figured out Tacy?

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SELECTing values on different records based on rules

    How's this coming John? Get it all figured out?

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Multi/Nested CONVERT's

    So the 16th of the previous month + 1s?

    SELECT DATEADD(s,1,DATEADD(d,15,DATEADD(m,-1,(DATEADD(mm, DATEDIFF(mm,0,GETDATE()), 0)))))

    Not a whole lot prettier, but no varchar conversions and it won't get screwed up in January like yours...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Looking for Input on Use of WHILE Loop In Job Step

    Depending on how many different entities / how long each takes / what kind of downtime you have in the evenings / etc, it might be worth looking into making...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 15 posts - 466 through 480 (of 1,473 total)