Forum Replies Created

Viewing 15 posts - 211 through 225 (of 304 total)

  • RE: Wierd Counter!

    Jeff Moden (10/27/2008)


    Thanks for the "cover". 🙂

    My pleasure, Jeff. I'm so glad for a chance to give back (and that Seth didn't grab it first 😉 )

  • RE: Wierd Counter!

    Anytime 🙂

  • RE: Wierd Counter!

    Jeff's script has a bug when the counter is equal to 10 and the next value is between 10 and 15.

    Try this one. It should work for you:

    UPDATE #Counter2

    ...

  • RE: Ordering and Reordering

    Thanks for posting the DDL.

    Can you please post some sample data as well?

  • RE: How to.....

    jcrawf02 (10/27/2008)


    http://www.sqlsaturday.com/%5B/url%5D

    You should be able to find one here if there is one, or start work on hosting one if you would like to. Excellent concept, I'm still trying...

  • RE: How to.....

    Jack Corbett (10/26/2008)


    Fraggle (10/26/2008)


    However, to my knowledge, SQL Saturday are Florida only.

    Actually SQLSaturday is NOT a Florida only thing. There have been SQLSaturday's in Washington state, Alabama,...

  • RE: how to find week start date and end date from a given week number

    swarooppavi (10/24/2008)


    If I pass week number, i need to get that weeks Monday date and Sunday date

    Not sure if this helps, but here's some code that accepts a date and...

  • RE: Regarding a while loop

    tinku.reddy (10/23/2008)


    Hi please help me

    i was trying to update using while loop

    Here is my code ....

    declare @y char(3)

    declare @count int

    set @y = 'no'

    set @count = 1

    select...

  • RE: Pivot table withiught aggregation

    Jeff Moden (10/26/2008)


    Guess I'm being a bit thick... I just don't see the correlation... sorry.

    Glad to know I'm not the only one who's not understanding this post. 🙂

    Paul, you need...

  • RE: excluding nulls from a table

    nailosuper (10/24/2008)


    Hi,

    I have a table which has some null values in "name" and "surname" columns. I use a function ti uppercase the first letter. But as i...

  • RE: Wierd Counter!

    Jeff Moden (10/24/2008)


    Just a note... You do have to remember that you MUST have a clustered index on the correct columns and then force it to be used to...

  • RE: Wierd Counter!

    Jeff Moden (10/24/2008)


    ggraber (10/24/2008)


    P.S. You may want to read Jeff's cool article on Running Totals which explains how this approach works http://www.sqlservercentral.com/articles/Advanced+Querying/61716/

    Heh... that's where I was going with this... I...

  • RE: Wierd Counter!

    You just need to add one criteria to the CASE statement. Like this:

    [font="Courier New"]

    UPDATE #Counter2

    SET @Counter = Counter = CASE WHEN (@Counter >= 1 AND @Counter < 10) OR ([Value]...

  • RE: Wierd Counter!

    P.S. You may want to read Jeff's cool article on Running Totals which explains how this approach works http://www.sqlservercentral.com/articles/Advanced+Querying/61716/

  • RE: Wierd Counter!

    This should work for you:

    [font="Courier New"]

    -- create a table to store our results

    -- create a dummy unique identifier on the table

    CREATE TABLE #Counter2

    (

       RowNumber INT IDENTITY(1,1)

       ,StartDate DATETIME

       ,[Value] FLOAT

      ...

Viewing 15 posts - 211 through 225 (of 304 total)