Hello,We are still on SQL 2000 and I need help with a query.We have a table named Reporthistory that records when a customer creates a report and subsequent actions on that report.A customer creates a report and a report_id is created also the Report_status_id is set to 1.Once the customer has completed any modifications to the report they can submit that report, which creates a new entry for that report is in the reporthistory table and sets the Report_status_id to 2.The customer can come back and “Un-submit” the report, which creates a new entry in the reporthistory for that report_id and sets the Report_status_id to 1

What I am wanting to achieve is a list of any reports that have a current status of 1 (submitted), and that report has been previously submitted.In other words, I need a list of reports where the status =1 and the previous status =2 for that same reported.I hope I have explained the problem and required solution. If I need to provide more clarification please let me know.Thanks in advance.CREATE TABLE [dbo].[Reporthistory] ( [ReportHistoryID] [int] IDENTITY (1, 1) NOT NULL , [Report_id] [int] NOT NULL , [Report_status_id] [int] NOT NULL , [modified_by] [int] NOT NULL , [last_modified] [datetime] NOT NULL ) ON [PRIMARY]GO

GF (9/21/2012)What I am wanting to achieve is a list of any reports that have a current status of 1 (submitted), and that report has been previously submitted.In other words, I need a list of reports where the status =1 and the previous status =2 for that same reported.

Might not be exactly what you need but hopefully gives you some ideas.