Select
[Employee Number],
[Timestamp] = Max([Timestamp])
Into #Current
From [dbo].[Rag Rated Table] as T1
Group By [Employee Number]
Select
[Employee Number],
[Timestamp] = min([Timestamp]),
[RAG Rating]
Into #Previous
From [dbo].[Rag Rated Table] as T1
Group By [Employee Number],[RAG Rating]
/*...