Hello,
I have a value change log table.
CREATE TABLE #LogTable (
CustomerID int
, LogDate datetime
, Value bit
)
Record is inserted, when value changes:
INSERT INTO #LogTable VALUES (1001, '2011-01-02', 1)
INSERT INTO #LogTable VALUES (1001, '2011-01-05', 0)
INSERT INTO #LogTable VALUES (1001, '2011-01-10', 1)
I need to get a result, which shows what value was on certain date. Result should look like:
1001, 2011-01-02, 1
1001, 2011-01-03, 1
1001, 2011-01-04, 1
1001, 2011-01-05, 0
1001, 2011-01-06, 0
1001, 2011-01-07, 0
1001, 2011-01-08, 0
1001, 2011-01-09, 0
1001, 2011-01-10, 1
1001, 2011-01-11, 1
1001, 2011-01-12, 1
If anyone has any idea how to get this result, please help.
Thanks.
P.S. And the bad news is that I have to run this on SQL Server 2000. 🙁