I have a table with the following schema:
DateTime [Creation Date] PK
int [Data]
The column data has values coming from a sensor, something like this:
123
225
354
578
0
2151
2331
0
2555
2678
As you can see the value always increments.
Due to a problem in the sensor we get from time to time a 0 between valid values. This is producing us several problems when we try to use the data so we want to fill these 0 gaps with something. Ideally we would like to put an average between the previous and the following value, if this is not possible we want to repeat the previous value.
Is this something doable with just a query?
Thanks in advance.