Forum Replies Created

Viewing 11 posts - 31 through 41 (of 41 total)

  • RE: Switching UNION to PIVOT?

    Here's an example table:

    CREATE TABLE Start

    (

    Start_ID CHAR(10) NOT NULL,

    School_State_Start CHAR(25) NOT NULL,

    )

    ;

    INSERT INTO Start

    (

    Start_ID,

    School_State_Start

    )

    VALUES

    ('1234', 'Ready'),

    ('5678', 'Ready'),

    ('6546', 'Ready'),

    ('9874', 'Ready'),

    ('6510', 'Ready'),

    ('9871', 'Ready'),

    ('3333', 'Soon'),

    ('1111', 'Soon'),

    ('2222', 'Soon'),

    ('4444', 'Soon'),

    ('5555', 'Soon'),

    ('6666', 'Soon'),

    ('7777', 'Soon'),

    ('9876', 'Someday'),

    ('9999', 'Someday'),

    ('1298', 'Someday'),

    ('4321', 'Someday')

    Here is the query I used to stack the results in SSMS to make analysis easier

    SELECT 'Ready' AS 'Current Cycle', COUNT(DISTINCT.Start.Start_ID)...

  • RE: Changing Data type from char to numeric

    Thanks for the explanation and example. Another of the many purposes of chicken... 🙂

  • RE: Changing Data type from char to numeric

    Evil Kraig F (4/30/2012)


    Until we see the error you're getting this is hard to troubleshoot, however, you might want to take a look at the column and WHERE test the...

  • RE: Changing Data type from char to numeric

    Thanks for the replies. Here is the error I'm receiving

    Error converting data type varchar to numeric.

    Here is the actual query, which is at the end of a few cte queries:...

  • RE: Getting example database setup - password problem

    Grant Fritchey (4/18/2012)


    GilaMonster (4/18/2012)


    DataAnalyst110 (4/18/2012)


    /****** Object: Login GalacticReporting Script Date: 5/23/2004 11:18:21 AM ******/

    if not exists (select * from master.dbo.syslogins where loginname = N'GalacticReporting')

    BEGIN

    declare @logindb nvarchar(132),...

  • RE: Getting example database setup - password problem

    SQLKnowItAll (4/18/2012)


    Take a look here at the sp_addlogin stored proc. It shows you the parameters.

    Thanks Jared. That's helpful.

  • RE: Getting example database setup - password problem

    GilaMonster (4/18/2012)


    DataAnalyst110 (4/18/2012)


    /****** Object: Login GalacticReporting Script Date: 5/23/2004 11:18:21 AM ******/

    if not exists (select * from master.dbo.syslogins where loginname = N'GalacticReporting')

    BEGIN

    declare @logindb nvarchar(132), @loginlang nvarchar(132)...

  • RE: Results split in SSMS window?

    Thanks Jared. That did just what I needed.

  • RE: Results split in SSMS window?

    One more question on this particular query. Notice I have to put "WHERE holder_Version_Code_Enrollment = 'AR-46'" in every SELECT statement. Is there any way to do this once for the...

  • RE: Results split in SSMS window?

    Thanks for pointing out the obvious 🙂 I was looking for something technical, and should have checked the syntax again!

  • RE: Results split in SSMS window?

    Thanks, Jared. Here she is...

    /*Primary Applications Received*/

    SELECT 'Primary Applications Received' AS 'Current Application Cycle', COUNT(DISTINCT Enrollment.Individual_ID) AS Count

    FROM Enrollment JOIN Individual_Status_Changes ON Enrollment.Enrollment_ID = Individual_Status_Changes.Enrollment_ID

    WHERE holder_Version_Code_Enrollment = 'AR-46'

    AND Individual_Status_Changes.Individual_New_Entity_Status =...

Viewing 11 posts - 31 through 41 (of 41 total)