Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)

  • RE: When SUMMING a column, why is a NULL value causing a problem?

    Thanks for enlightening me!

    I kinda knew there was a stupid error on my part, but I just could not see it!

  • RE: How to get monthly YTD data

    DECLARE @dt DATE

    -- YOU HAVE THREE OPTIONS HERE, DEPENDING UPON YOUR NEED:

    -- [1] SET @dt = '2010-09-23' ...

  • RE: @@TRANCOUNT

    @@TRANCOUNT = 0 before and after the insert. So why is 2 being written to the table?

    CREATE TABLE #temp (col1 int);

    SELECT @@TRANCOUNT

    BEGIN TRAN

    ROLLBACK TRAN

    SELECT @@TRANCOUNT

    INSERT INTO #temp VALUES (@@TRANCOUNT);

    SELECT...

  • RE: Add Space between text and number in same field

    -- Create a tally table as taught by Jeff Moden

    SELECT top 30 IDENTITY(int) ii into aux from sys.objects;

    --------------------------------------------------------

    SELECT col1, STUFF(col1, MIN(ii), 0, ' ')

    FROM

    (

    SELECT col1, ii

    FROM Table1

    CROSS JOIN...

  • RE: FizzBuzz

    Jeff, with all due respect, I raced against the clock (5 min, 12 seconds) to complete this.

    The crux of the challenge was to code a successful solution in the...

  • RE: FizzBuzz

    WITH bozo (i) as

    (

    select 1

    union all select i+1 from bozo where i < 100

    )

    SELECT CASE when i % 3 = 0 and i % 5 = 0 then 'Fizzbuzz' when...

  • RE: Concatenating Rows

    ------ CREATE AND LOAD THE TABLE

    create table aaatrash(id int, name varchar(20))

    insert into aaatrash

    select 1, 'apple'

    union...

Viewing 7 posts - 1 through 7 (of 7 total)