Forum Replies Created

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

  • RE: How do I remove the Nulls in my output?

    There's alway that smart ***:-) I'm impressed by your knowledge of SQL. I didn't know this option existed. Honestly much of your code and the logic of your solution escapes...

  • RE: How do I remove the Nulls in my output?

    CREATE TABLE #Total_Count

    (NUM_DEATHS_1870 numeric (8,0), NUM_DEATHS_1880 numeric(8,0))

    INSERT INTO #Total_Count (NUM_DEATHS_1870, NUM_DEATHS_1880)

    (SELECT COUNT (*), 0

    FROM [dbo].[1870_1880_DAT]

    WHERE YR_Died = '1870')

    INSERT INTO #Total_Count (NUM_DEATHS_1870, NUM_DEATHS_1880)

    (SELECT 0, COUNT (*)

    FROM [dbo].[1870_1880_DAT]

    WHERE YR_Died =...

  • RE: How do I remove the Nulls in my output?

    I'm learning SQL and much respect for those who program in SQL. Thank you. I learned something. My solution will paint me into a corner. My goal was to declare...

  • RE: How do I remove the Nulls in my output?

    CREATE TABLE #Total_Count

    (NUM_DEATHS_1870 numeric (8,0) NOT NULL, NUM_DEATHS_1880 numeric(8,0) NOT NULL)

    INSERT INTO #Total_Count (NUM_DEATHS_1870)

    (SELECT COUNT (*) COD

    FROM [dbo].[1870_1880_DAT]

    WHERE YR_Died = '1870')

    INSERT INTO #Total_Count (NUM_DEATHS_1880)

    (SELECT COUNT (*) COD...

  • RE: How do I remove the Nulls in my output?

    (NUM_DEATHS_1870 numeric (8,0) Not Null, NUM_DEATHS_1880 numeric(8,0) Not Null)

    How would I add 0's to INSERT?

  • RE: Why does this not retrn a value?

    Use NV_morality_Study

    Go

    DECLARE @total_count AS int

    SET @total_count =

    (SELECT COUNT (*) COD

    FROM [dbo].[1870_1880_DAT])

    SELECT @total_count AS [total count]

    Returns 1355

    DECLARE @cause_count AS int

    SET @cause_count =

    (SELECT COUNT(*)

    FROM [dbo].[1870_1880_DAT]

    WHERE [COD] = 'Pneumonia')

    SELECT @cause_count AS [cuase...

  • RE: Why does this not retrn a value?

    I just tested these two statements outputs. The output was correct. The SELECT @cuase_count/@total_count As [Percent] failed.

  • RE: Hiring Heterogeneously

    I'm a 60 year old unemployed person who enjoyed working in engineering. I can't break the habit of working. I create projects to work on. It was starting one of...

  • RE: White space

    I heard TSQL defaulted in SELECT DISTINCT queries to sorting by ASC. The ORDER BY worked.

    My next problem will be to order by the number of entries...

  • RE: White space

    I tried the first set of code.

    UPDATE [dbo].[1870_1880_DAT]

    SET [TOWN] = rtrim(ltrim([TOWN]))

    WHERE [TOWN] <> rtrim(ltrim([TOWN]))

    The query ran with out errors.

    I tested the query's output by using a SELECT...

  • RE: White space

    I imported the csv file into Excel to edit it. I wanted to clean up the data before I created a table.

    As I have stated. Part of my goal as...

  • RE: White space

    Thanks, for you time answering my question.

    After creating a csv file, importing it into a Excel spreadsheet and finally importing it into a SQL table I notices white space both...

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