Here is a small sample of data from a table of about 500 rows
(Using MSSqlserver 2000)
EntryTime Speed Gross Net
------------------ ----- -----
21:09:13.310 0 0 0
21:09:19.370 9000 NULL NULL
21:09:21.310 NULL 95 NULL
21:10:12.380 9000 NULL NULL
21:10:24.310 NULL 253 NULL
21:11:24.370 8000 NULL NULL
21:11:27.310 NULL 410 NULL
21:11:51.320 NULL 438 NULL
21:11:51.490 NULL NULL 10
After the first row, every row has only one value of the three.
I would like to replace all the NULL values with calculated
interpolations.
I can do it w/ cursors or while loops.
I could do it w/ VB (I think)
Can this be done w/ an Update statement using self joins?
What would be the best way?
The value for speed can increase or decrease over time, but can never
be < 0
Net is always less than gross, and neither can go below 0.
TIA for any helpful suggestions.
Thanks,
BM
(Using MSSqlserver 2000)
EntryTime Speed Gross Net
------------------ ----- -----
21:09:13.310 0 0 0
21:09:19.370 9000 NULL NULL
21:09:21.310 NULL 95 NULL
21:10:12.380 9000 NULL NULL
21:10:24.310 NULL 253 NULL
21:11:24.370 8000 NULL NULL
21:11:27.310 NULL 410 NULL
21:11:51.320 NULL 438 NULL
21:11:51.490 NULL NULL 10
After the first row, every row has only one value of the three.
I would like to replace all the NULL values with calculated
interpolations.
I can do it w/ cursors or while loops.
I could do it w/ VB (I think)
Can this be done w/ an Update statement using self joins?
What would be the best way?
The value for speed can increase or decrease over time, but can never
be < 0
Net is always less than gross, and neither can go below 0.
TIA for any helpful suggestions.
Thanks,
BM
Comment