Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6602803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:55:15+00:00 2026-05-25T18:55:15+00:00

HISTORY: A system has passed through 1 – 19 or so statuses before being

  • 0

HISTORY: A system has passed through 1 – 19 or so statuses before being moved to production. I need to build a report showing the date the system passed through a status and NA if the system did not pass through a status.

REQUIREMENTS: The report needs to look something like this:

System      Initial     Operations  PIM_Assigned    PIM_Complete    Database    Application 
Server001   9/1/2011    NA          9/2/2011        NA              NA          9/1/2011
Server002   9/10/2011   NA          9/5/2011        9/25/2011       NA          9/9/2011
Server003   9/21/2011   9/22/2011   NA              NA              9/24/2011   NA
Server004   9/23/2011   9/19/2011   9/23/2011       9/20/2011       9/23/2011   9/1/2011

Here is the query with a sample data dump following (dump does not match above – the above is for illustration purposes):

select status, convert(varchar,effectivedate,101) e, systemname  
from si_statushistory
where systemname='SERVER052'  
order by e desc, history_id desc

with output from my query looking like this:

PSI            09/09/2011   SERVER052  
Application    09/09/2011   SERVER052  
Operations     09/09/2011   SERVER052  
Application    07/14/2011   SERVER052  
Operations     07/13/2011   SERVER052  
Operations     07/13/2011   SERVER052  
PSI            07/13/2011   SERVER052  
PIM Assigned   06/08/2011   SERVER052  
PSI            06/08/2011   SERVER052  
SD_Verify      01/15/2012   SERVER052  
PSI Operations 01/08/2012   SERVER052  
Frame Team     01/01/2011   SERVER052

Example of what ONE row would look like:

something is missing here

I hope this is clear and makes sense…

The page is being displayed using Coldfusion and I’m adequate with using Arrays and Structures if that makes this easier to build out. Time of of the essence which is why I’m reaching out for some help. I could do this but I need it sooner than later.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:55:16+00:00Added an answer on May 25, 2026 at 6:55 pm
    CREATE PROCEDURE dbo.ReturnPivotedSystemInfo
    AS
    BEGIN
        SET NOCOUNT ON;
    
        ;WITH x AS
        (
            SELECT 
                [system] = systemname, 
                [status], 
                ed = CONVERT(CHAR(10), effectivedate, 101), -- not varchar w/o length
                rn = ROW_NUMBER() OVER 
                    (PARTITION BY systemname, status ORDER BY effectivedate DESC)
            FROM dbo.si_statushistory
            -- where clause here
        )
        SELECT [system], 
            Initial      = COALESCE(MAX(CASE WHEN [status] = 'Initial'      THEN ed END), 'NA'),
            Operations   = COALESCE(MAX(CASE WHEN [status] = 'Operations'   THEN ed END), 'NA'),
            PIM_Assigned = COALESCE(MAX(CASE WHEN [status] = 'PIM Assigned' THEN ed END), 'NA')
            --, repeat for other possible values of status
        FROM x
        WHERE rn = 1
        GROUP BY [system];
    END
    GO
    

    Now your ColdFusion just needs to execute the stored procedure dbo.ReturnPivotedSystemInfo and from there on it should be able to behave just as if you had called SELECT * FROM sometable…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Team System 2010 has some new features that really interest me including branched history,
I'd like to include revision history in a menu system of my builds so
I have a History Table in SQL Server that basically tracks an item through
If I were to implement a system identical to the StackOverflow question revision history
I need to perform a database restore from my application. Before doing this, I
We are reviewing the design of a system. And need to verify what we
Our company has a point of sale system with many extras, such as ordering
Every modern source control system can slice and dice the history of a program.
I am interested in keeping a running history of every change which has happened
Backgroun: I'm trying to build a private messaging system in Mysql with conv view.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.