Given your test data in a table called Test_1 With Fields Called [Timestamp], NValue, TxtCode, the following does what you want.
Code:
SELECT
[Timestamp], NValue, TxtCode
FROM
(
SELECT
ROW_NUMBER() OVER(Partition By Interval_15 Order BY [TimeStamp] ) as RowNum,*
FROM (
SELECT
DATEADD(MINUTE, FLOOR(DATEDIFF(MINUTE, '2020-01-01', [TIMESTAMP]) / CAST(15 AS DECIMAL)) * 15, '2020-01-01') AS Interval_15,*
From
Test_1
) as q1
) as q2
Where RowNum = 1
Results
Code:
Timestamp NValue TxtCode
2021-01-11 11:30:09.000 0.9014763960 A
2021-01-11 11:45:09.000 0.8264825220 B
2021-01-11 12:00:09.000 0.0000000000 C
2021-01-11 12:15:09.000 0.0000000000 A
The Row_Number is a T_SQL window function. If you just run the centre query (q1) on it's own, then the second one (q2) with the first one it will become obvious how they work.
You could probably mash it all into one massive Select statement but it's easier to see what is happening with the sub queries.