Hi I have data from a history table that is being populated using an update trigger. It collects all fields from the table for 'deleted' and 'inserted' and places them into a history table. Please run the code below for a brief sample.Now I would like a query that would allow me to display this history to a visitor in my application like so:On 4/19/2001 User 2 Change Value From 16.79 To 2.99.On 4/19/2001 User 2 Change Value From 2.99 To 2.97.On 4/19/2001 User 2 Change Description From LONG ROLL FILM To SHORT ROLL FILM.On 4/19/2001 User 2 Change Description From SHORT ROLL FILM To LONG ROLL FILM.On 4/19/2001 User 2 Change Value From 2.97 To 3.42.So I would need to know what fields have changed, the before value and after value for each group of 2 rows. I hope I explained that correclty.Any help would be appreciated. Thanks.Here is some test data to work with.USE [Test]GOCREATE TABLE [dbo].[Brimms_History22]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [BrimmsID] [bigint] NOT NULL, [PartNo] [varchar](50) NOT NULL, [Description] [varchar](255) NOT NULL, [Value] [money] NOT NULL, [UpdateBy] [int] NOT NULL, [UpdateDate] [datetime] NOT NULL, [TriggerFunction] [varchar](50) NOT NULL, CONSTRAINT [PK_Brimms_88] PRIMARY KEY CLUSTERED ( [ID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOInsert Into [dbo].[Brimms_History22] (BrimmsID, PartNo, [Description], [Value], UpdateBy, UpdateDate, TriggerFunction)Values (5,'CK-57458','LONG ROLL FILM',16.79,2,'2011-04-19 15:41:13.547','Old-Value')Insert Into [dbo].[Brimms_History22] (BrimmsID, PartNo, [Description], [Value], UpdateBy, UpdateDate, TriggerFunction)Values (5,'CK-57458','LONG ROLL FILM',2.99,2,'2011-04-19 15:41:13.547','New-Value')Insert Into [dbo].[Brimms_History22] (BrimmsID, PartNo, [Description], [Value], UpdateBy, UpdateDate, TriggerFunction)Values (5,'CK-57458','LONG ROLL FILM',2.99,2,'2011-04-19 15:41:19.547','Old-Value')Insert Into [dbo].[Brimms_History22] (BrimmsID, PartNo, [Description], [Value], UpdateBy, UpdateDate, TriggerFunction)Values (5,'CK-57458','LONG ROLL FILM',2.97,2,'2011-04-19 15:41:19.547','New-Value')Insert Into [dbo].[Brimms_History22] (BrimmsID, PartNo, [Description], [Value], UpdateBy, UpdateDate, TriggerFunction)Values (5,'CK-57458','LONG ROLL FILM',2.97,2,'2011-04-19 15:41:25.547','Old-Value')Insert Into [dbo].[Brimms_History22] (BrimmsID, PartNo, [Description], [Value], UpdateBy, UpdateDate, TriggerFunction)Values (5,'CK-57458','SHORT ROLL FILM',2.97,2,'2011-04-19 15:41:25.547','New-Value')Insert Into [dbo].[Brimms_History22] (BrimmsID, PartNo, [Description], [Value], UpdateBy, UpdateDate, TriggerFunction)Values (5,'CK-57458','SHORT ROLL FILM',2.97,2,'2011-04-19 15:41:31.547','Old-Value')Insert Into [dbo].[Brimms_History22] (BrimmsID, PartNo, [Description], [Value], UpdateBy, UpdateDate, TriggerFunction)Values (5,'CK-57458','LONG ROLL FILM',3.42,2,'2011-04-19 15:41:31.547','New-Value')Select * From [dbo].[Brimms_History22]Drop Table [dbo].[Brimms_History22]
JBelthoff› As far as myself... I do this for fun!