Here\'s a fictional scenario with some populated data. For tax purposes, my fictional company must retain records of historical data. For this reason, I\'ve included a version c
Here is my suggested approach, which has worked very well for me in the past:
StartDate
and EndDate
columnsID
, and that there is only ever one record with a NULL
EndDate
for the same ID
(this is your currently effective record)StartDate
and EndDate
; this should give you reasonable performanceThis will easily let you report by date:
select *
from MyTable
where MyReportDate between StartDate and EndDate
or get the current info:
select *
from MyTable
where EndDate is null