1. Helge Tjelta
  2. Valentina Studio
  3. 月, 8月 12 2019, 08:02 PM
  4.  メールで購読
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 承諾済みの回答
Seems to be a bug. What the values in Time_end and Time_start?
コメント
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 承諾済みの回答
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 承諾済みの回答
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 承諾済みの回答

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 承諾済みの回答
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 承諾済みの回答
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.
Ivan Smahin 承諾済みの回答
コメント
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. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories