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 6883403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:22:45+00:00 2026-05-27T05:22:45+00:00

This is running on SQL Server 2000 Background: when a new server is brought

  • 0

This is running on SQL Server 2000

Background: when a new server is brought onto the network, it will pass through a series of status (stages) such as (loading, testing, configuring, production, etc) were production is the final step (not every server in the report will be in production so this bit of information may be a moot point).

I inherited this so if there are any questions, I’ll answer them as best as I can. I’m trying to run a query to get the latest status of all the servers during a specific time frame. My query is currently returning every status for the server and I only need the current status and that is where I need your help.

The query I’m working with is as follows:

SELECT SD.ProjectName, SD.SystemName, SD.Status, H.history_id
FROM dbo.SI_SystemDetail AS SD 
INNER JOIN dbo.SI_Projects AS P ON SD.ProjectName = P.ProjectName 
INNER JOIN dbo.SI_StatusHistory AS H ON SD.SystemName = H.SystemName   
WHERE     
    (P.Cancelled = 'N') 
    AND (P.Platform LIKE '%ibm%') 
    AND ('20110101' <= CONVERT(varchar(8), H.EffectiveDate, 112)) 
    AND (CONVERT(varchar(8), H.EffectiveDate, 112) <= '20111111')   
ORDER BY 
     H.history_id DESC, SD.SystemName, SD.ContactSBCuid, SD.ActualLiveDAte DESC, 
     SD.ProjectName, SD.SystemType, H.EffectiveDate`

This will return several duplicates for systemname but I only need one and that should correspond with the highest history_id number. For example, lets say there is a server named:

Server Name        Status       History_ID  
Server01           Loading      1001
Server01           Configuring  1081
Server01           Testing      1101
Server01           Production   1451
Server02           Loading      1002
Server02           Configuring  1083
Server02           Testing      1104
Server02           Failed       1455

I would just need the following results returned:

Server Name        Status       History_ID  
Server01           Production   1451
Server02           Failed       1455

Thanks in advance for the assistance.

  • 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-27T05:22:46+00:00Added an answer on May 27, 2026 at 5:22 am

    UNTESTED:

    SELECT SD.ProjectName, SD.SystemName, SD.Status, H.history_id 
    FROM dbo.SI_SystemDetail AS SD 
    INNER JOIN dbo.SI_Projects AS P 
      ON SD.ProjectName = P.ProjectName 
    INNER JOIN dbo.SI_StatusHistory AS H 
      ON SD.SystemName = H.SystemName
    WHERE (P.Cancelled = 'N') AND (P.Platform LIKE '%ibm%') AND ('20110101' <= CONVERT(varchar(8), H.EffectiveDate, 112)) AND (CONVERT(varchar(8), H.EffectiveDate, 112) <= '20111111')
    AND history_ID = (
      Select max(history_ID) 
      FROM SI_Status_History iSH 
      where iSH.SystemName = SD.SystemName)
    ORDER BY H.history_id DESC, SD.SystemName, SD.ContactSBCuid, SD.ActualLiveDAte DESC, SD.ProjectName, SD.SystemType, H.EffectiveDate
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A slightly tricky SQL question (we are running SQL server 2000). I have the
In Sql Server 2000 and 2005 I am running a select statement in a
I've got a database running on a clients SQL Server 2000 box where the
We have an old Windows 2000 server running SQL Server 2000 Standard Edition, SP3.
When running a very simple query in SQL Server 2000. SELECT getDate() Most queries
[Disclaimer]: Currently we are running older SQL Server 2000, but we could update to
Need help with this SQL Server 2000 procedure. The problem is made difficult because
Im running this query on the same server as the web application, so SPQuery.ExpandRecurrence
I'm in javascript, running this in the console d = new Date(); d.setMonth(1); d.setFullYear(2009);
SQL Server 2000 on Windows Server 2003. I am trying to run a backup,

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.