1. Helge Tjelta
  2. Valentina Studio
  3. Понедельник, Август 12 2019, 08:02 PM
  4.  Подписаться через email
When entering:
datediff(Time_end, Time_start, 'second')as seconds it shows the right number

but
Sec_to_time(datediff(Time_end, Time_start, 'second')as seconds) shows <NULL>

Any idea; why can I not get a H:M:S from my DateDiff that returns seconds ???...
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
Seems to be a bug.

You may use following as a workaround:


set @val_seconds = select datediff( '08/14/2019 01:30:00', '08/13/2019 20:30:00', 'second');
select sec_to_time( @val_seconds);
Комментарий
There are no comments made yet.
Helge Tjelta Ответ принят
Ok, try this:

select datediff( '08/14/2019 01:30:00', '08/13/2019 20:30:00', 'second')
result: 18000
Now put that into sec_to_time
select sec_to_time (datediff( '08/14/2019 01:30:00', '08/13/2019 20:30:00', 'second'))
result: <NULL>
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят

select datediff( '08/13/2019 00:00:00', '07/13/2019 00:00:00', 'second')
-- 2678400


It is correct. But how "month" could be represented as a time_value? It must be a DateTime.


select dateadd( '07/13/2019 00:00:00', 'second', 2678400 )
-- '08/13/2019 00:00:00'
Комментарий
There are no comments made yet.
Helge Tjelta Ответ принят
But why does: datediff(Time_end, Time_start, 'second')as seconds shows the right number then ?

isn't it the same... but with one added expression ?

or is it that the sec_to_time, needs a number and not a string...

is there a command for converting string to number. like VAL(string) ?
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
It seems that seconds could not be represented as a Time_value because there is a date part also.
Комментарий
There are no comments made yet.
Helge Tjelta Ответ принят
Full date and time. Inputted in studio for the test.
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
Seems to be a bug. What the values in Time_end and Time_start?
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories