Home Forums SQL Server 2008 SQL Server Newbies How to get the latest record before a defined value in a field RE: How to get the latest record before a defined value in a field

  • Add a row number with ROW_NUMBER() OVER (ORDER BY Timestamp).

    Find the row where Manual = 10 and get its row number x. The row you seek has row number (x + 1).

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP