sql - Showing only hours and minutes? -


how display hours , minutes in field if them separately

[select      d.numoperador,     sum(datediff(minute, d.fechasalida, d.fechallegada)) / 60 \[horas\] ,     sum(datediff(minute, d.fechasalida, d.fechallegada)) % 60 \[minutos\]           trkoperadores o     inner join trfdespacho d on o.numoperador = d.numoperador      o.cvetipooperador = 2      , o.numoperador = 900200      , d.fechasalida>='2017-03-10 00:00:00.000' , d.fechallegada<='2017-03-11 00:00:00.000' group      d.numoperador; go] 

time

if want join hrs , mns in result, concatenate both of them :

  select  d.numoperador,   ( cast ( sum(datediff(minute, d.fechasalida, d.fechallegada)) / 60 varchar)  +  cast ( sum(datediff(minute, d.fechasalida, d.fechallegada)) % 60 varchar )  ) time   trkoperadores o inner join trfdespacho d on o.numoperador = d.numoperador  o.cvetipooperador = 2  , o.numoperador = 900200  , d.fechasalida>='2017-03-10 00:00:00.000' , d.fechallegada<='2017-03-11 00:00:00.000'  group  d.numoperador; go]  

Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -