Dhruv Nautiyal
Dhruv Nautiyal

Reputation: 129

Compare Time for two different columns and create third column which shows the difference in time

Hi i have two columns with n number of rows of time in 24 hour format.

I want to compare the time for each row, which means entire Column1 compared with Column2 = result_Column3(time diff for both the columns)

Upvotes: 0

Views: 99

Answers (1)

vaibhavk7
vaibhavk7

Reputation: 64

You can update your result_Column3 as,

UPDATE tblData SET result_Column3 = CONCAT((DATEDIFF(Minute,Column1,Column2)/60),':',(DATEDIFF(Minute,Column1,Column2)%60))

Upvotes: 1

Related Questions