Showing posts with label timestamp. Show all posts
Showing posts with label timestamp. Show all posts

Thursday, 21 December 2023

Adding Timestamp upon Cell Modification | Excel

Enabling a Timestamp in Excel Upon Cell Modification without Overwriting Existing Timestamps

To achieve this, follow these steps:

Step 1: Enable Iteration in Excel Options

Navigate to Options -> Formula -> Iteration and ensure the option is enabled.

Step 2: Adding Timestamps to Column B on Change in Column C

Suppose your values are in Column C, and you want to track timestamps in Column B. Apply the following formula in Column B:

=IF(C2<>"", IF(B2="", CONCAT(MINUTE(NOW()), ":", SECOND(NOW())), B2), "")


This formula will only update the timestamp in Column B if a change is made in the corresponding cell of Column C, ensuring it doesn't overwrite existing timestamps.


Friday, 28 February 2020

Find Records Between Specific DateTime Range | SQL

This Query is written in DB2 with Maximo on Workorder table, but I believe its the same for almost all.


SELECT w.reportdate
,to_date(to_char(CURRENT timestamp-1,'YYYY-MM-DD')||' 05:00:00','YYYY-MM-DD HH24:MI:SS' ) yesterday
,to_date(to_char(CURRENT timestamp,'YYYY-MM-DD')||' 05:00:00','YYYY-MM-DD HH24:MI:SS' ) today
FROM WORKORDER W
WHERE 1=1
--FETCH FIRST 10 ROWS ONLY
AND W.reportdate BETWEEN to_date(to_char(CURRENT timestamp-1,'YYYY-MM-DD')||' 05:00:00','YYYY-MM-DD HH24:MI:SS' ) AND to_date(to_char(CURRENT timestamp,'YYYY-MM-DD')||' 05:00:00','YYYY-MM-DD HH24:MI:SS' )

for Oracle: Use Sysdate instead of Current Timestamp