Jump to content
  • 0

Time stamp duration between records in hrs


Sherif
 Share

Question

5 answers to this question

Recommended Posts

  • 0

Hi @Sherif,

Could you please elaborate your desired workflow? Initially, as I understand, you need to calculate the time in hours between the current and previous record with the same ID. Would you like to save it on your Table or just display it in a reports? 

You may refer to this article for reference in your Formula: https://howto.caspio.com/function-reference/

 

Regards,

kristina

Link to comment
Share on other sites

  • 0

Hello @Sherif

The formula should look something like this:

DATEDIFF(
  hh,
    (SELECT TOP 1 (Name_Of_Your_Date_Field)
    FROM Your_Table_Name
    WHERE Name_Of_ID_Field = target.[@field:Name_Of_ID_Field] 
    AND Name_Of_Your_Date_Field < target.[@field:Name_Of_Your_Date_Field]
    ORDER BY Name_Of_Your_Date_Field desc),
  target.[@field:Name_Of_Your_Date_Field]
)

This formula selects the last one entry with the same ID you have entered and return the difference in hours between submitted date and selected date.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...