1. Helge Tjelta
  2. Valentina Studio
  3. Montag, August 12 2019, 08:02 PM
  4.  Abonnieren via E-Mail
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 ???...
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Seems to be a bug. What the values in Time_end and Time_start?
Kommentar
There are no comments made yet.
Helge Tjelta Akzeptierte Antwort
Full date and time. Inputted in studio for the test.
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
It seems that seconds could not be represented as a Time_value because there is a date part also.
Kommentar
There are no comments made yet.
Helge Tjelta Akzeptierte Antwort
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) ?
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort

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'
Kommentar
There are no comments made yet.
Helge Tjelta Akzeptierte Antwort
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>
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
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);
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Kommentar
There are no comments made yet.
  • Seite :
  • 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