Consulting

Results 1 to 3 of 3

Thread: TIMESTAMPDIFF from one column (SQL Server)

  1. #1
    VBAX Regular
    Joined
    Aug 2022
    Posts
    7
    Location

    TIMESTAMPDIFF from one column (SQL Server)

    Hi,
    I'm new to SQL Server and i have question:
    Is it even possible to somehow use TIMESTAMPDIFF to calculate values from same column?
    I mean some kind of loop that will calculate
    TIMESTAMPDIFF(SECOND, Value.row1, Value.row2) and puts it in next column in row1.
    Table has variable amount of rows (usualy 20k+, depending on query details).


    Or any other idea how to calculate
    TIMESTAMPDIFF if each data is in separate row, like in this excel example:


    Now it's solved by feeding raw data into PowerBI/PowerQuery but it isnt perfect, not to mention tons of .csv/.xls files on shared disk and lack of those timestamps diff in SQL database

  2. #2
    here is a demo.
    Attached Files Attached Files

  3. #3
    VBAX Regular
    Joined
    Aug 2022
    Posts
    7
    Location
    Yea, but this is just excel macro (or im missing something).
    I'm looking for a way to implement this on SQL Server database.
    I don't have access to this database on weekends, mybe on monday i will make some screens on how it looks right now in SQL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •