I am new to SQL Server databases and queries.
I have a SQL Server database table with DateTime and Current. Current may have NULL values.
I want to replace NULL values in Current column with zeros only when either previous or next record has some value. Provided DateTime sorted in Ascending order.
Please help me to write a SQL query or a combination of stored procedure and SQL query.
Also help me to sort the existing table with DateTime in Ascending order. DateTime is not a running series.