I have a set of records in my MS SQL table. With Date as the primary key. But the Dates are only for working days and not the continues days. Eg:
1/3/2000 12:00:00 AM 5209.540000000 5384.660000000 5209.540000000 5375.110000000 1/4/2000 12:00:00 AM 5533.980000000 5533.980000000 5376.430000000 5491.010000000 1/5/2000 12:00:00 AM 5265.090000000 5464.350000000 5184.480000000 5357.000000000 1/6/2000 12:00:00 AM 5424.210000000 5489.860000000 5391.330000000 5421.530000000 1/7/2000 12:00:00 AM 5358.280000000 5463.250000000 5330.580000000 5414.480000000 1/10/2000 12:00:00 AM 5617.590000000 5668.280000000 5459.970000000 5518.390000000 1/11/2000 12:00:00 AM 5513.040000000 5537.690000000 5221.280000000 5296.300000000 1/12/2000 12:00:00 AM 5267.850000000 5494.300000000 5267.850000000 5491.200000000
In this i am trying to introduce a new column to the table and the value to it should be the value of the 3rd cloumn minus the value of 3rd column of the previous working day. Please help me in writing such a query. I am finding it difficult as the dates are not present for the week ends.