Forum Replies Created

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

  • RE: Merging duplicate rows

    Please do not double post. It clutters things up and is generally confusing.

    The other thread... http://www.sqlservercentral.com/Forums/Topic594962-338-1.aspx

    Maybe I'm missing something... but I don't see where that script generates that...

    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: grouping by 60 minute time periods...

    This should do it. In place of the bogus data and the table variable I'm using, create a temp table (with the exact same definition, the index is vital)...

    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: Date issue

    Try this:

    SELECT CONVERT(datetime,'27/08/2008 05:37',103)

    The 103 specifies that the date is in British/French format.

    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: To get records from a few days ago...

    GilaMonster (10/31/2008)


    Garadin (10/31/2008)


    Syntax issue.

    Use this instead:

    select id, name, changedate

    from table1

    where changedate > GETDATE()-5

    Beware of the time portion of dates. That, if run now, would miss any entries with a time...

    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: To get records from a few days ago...

    Syntax issue.

    Use this instead:

    select id, name, changedate

    from table1

    where changedate > GETDATE()-5

    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: Expressions based on data in the SELECT statement

    A good attempt, especially if this gives you the data you were after. These aren't quite derived tables, as they make reference outside themselves and are recursive. Here'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: SQL Cursor problem

    luissantos,

    If you can post some table Definition / Sample Data for this (an example of how to do this is in my signature), we can help you write...

    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: constructing a stored proceedure

    I stumbled across a very tricky way to create this table in the beginning a couple months ago. Apparently it's a pretty standard VB trick, but my background is...

    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: compressing / collapsing numbers

    The link in my signature will give you an example of the proper way to post the information Greg is asking for. It's a good article to read for...

    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: Need help on performance and integrity

    GIMME A BREAK HERE !!

    I was focused on showing the compromise solution to the duplicates only, since no one had any problems identifying the breaks. How...

    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: Need help on performance and integrity

    Row 5 should be included, as it's a code change. He doesn't want *dupes* of C, but if it's a code change, it is still included.

    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: How to print null when no sales is present

    Yes Garadin, I understood what you meant but I couldn’t see an other way to do it. I was thinking to create fake data and do it. But it is...

    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: Need help on performance and integrity

    The box is from the QUOTE tags. I responded to your message. I know it's fast, that's what's weird about it. It *should* be slow... but it'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: How to print null when no sales is present

    Putting criteria in your WHERE that references your LEFT JOINED table prettymuch negates the entire purpose of left joining.

    Heh, you just came full circle on this one and did...

    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: Need help on performance and integrity

    ;with cte1 as -- identify breaks

    (select t1.RowID,t1.code

    from #temptable t1

    where t1.code <> (select top 1 code from #temptable where RowID < t1.rowID order by rowID desc)

    )

    This is a set based solution...

    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 - 1,201 through 1,215 (of 1,473 total)