Find Difference between Start and End timestamps


hi all

i have following table

code      name        day_of_week       start_time                                 end_time                                 minutes

0001      abc              0                     30/12/1899 10:50:00                 30/12/1899 12:10:00                null

0001      abc              1                     30/12/1899 10:50:00                 30/12/1899 12:10:00                null              

0001      abc              1                     30/12/1899 12:10:00                 30/12/1899 13:30:00                null

0002      def              0                      30/12/1899 12:10:00                 30/12/1899 13:30:00                null

0002      def              1                      30/12/1899 10:50:00                 30/12/1899 12:10:00                null

....................

................................

......................................

 

data type -  start_time, end_time , minutes datetime

i want take difference between strat_time , end_time minutes

thanks

 

 

hi vishal,

maybe wants store value, in cases not necessary while redundant... transposing update statement huge task .)

update  [yourtable]  set     [minutes] = datediff(minute, [start_time], [end_time]) ;

microsoft mvp office access
https://mvp.support.microsoft.com/profile/stefan.hoffmann


SQL Server  >  Transact-SQL



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........