hidrau
asked on
how to add minutes to my hours?
Hello guys
I have this code:
How is the correct form?
thanks
I have this code:
declare @start_time time;
declare @elapse_time time;
set @start_time = '13:30:00'
Set @elapse_time= '00:30:00'
SELECT DATEADD(mi, @start_time, @elapse_time)
How is the correct form?
thanks
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
In that case it will be 14:40
No need to convert to INT. the function dateadd will automatically handle it.
No need to convert to INT. the function dateadd will automatically handle it.
/*------------------------
declare @start_time time;
declare @elapse_time time;
set @start_time = '13:30:00'
Set @elapse_time= '01:10:00'
SELECT DATEADD(SECOND,DATEDIFF(SECOND,'00:00:00',@start_time),@elapse_time) AS finalTime
------------------------*/
finalTime
----------------
14:40:00.0000000
(1 row(s) affected)
edited my last comment.
ASKER
Pawan,
declare @PREVISAO_INICIO datetime;
declare @TEMPO_ESTIMADO varchar(10);
set @PREVISAO_INICIO = '20171101 13:00:00'
set @TEMPO_ESTIMADO = '001 00:30:00' -- ddd hh:mm:ss
how to make this calc in MSSQL
declare @PREVISAO_INICIO datetime;
declare @TEMPO_ESTIMADO varchar(10);
set @PREVISAO_INICIO = '20171101 13:00:00'
set @TEMPO_ESTIMADO = '001 00:30:00' -- ddd hh:mm:ss
how to make this calc in MSSQL
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Pawan, you helped me a lot.
Thank you very very much
Thank you very very much
ASKER
thanks a lot
ASKER
If I have this value '01:10', I should convert the value to integer and add to my dateadd.
In this case, '01:10' how could I convert the value to integer in a correct way so the result would be 70?