Announcement
Collapse
No announcement yet.
timestampdiff on V5R3
Collapse
X
-
Re: timestampdiff on V5R3
The Second Parameter must be CHAR(22) representing the timestamp difference without separators and NOT a numeric value!
Because SQL functions can be overloaded, a function TIMESTAMPDIFF with an Integer and a numeric parameter is searched which does not exist.
That's why the function is not found.
BirgittaCode:select timestampdiff( 8, Cast(current_timestamp-SNPSHT as Char(22)) as fish from jrnrcvnow
-
Re: timestampdiff on V5R3
RTFM!
It is correctly (for my data) giving me 1.00 as it is over 1 hour difference.Code:select cast((timestampdiff(2,cast(current_timestamp-SNPSHT as char(22)))/3600) as dec(3,2)) as frog from jrnrcvnow
.... even to go a bit further ...
Gives me the correct figure of 1.32 Hours (at time of run)Code:select cast( real( timestampdiff ( 2, cast( current_timestamp - SNPSHT as char(22) ) ) ) / 3600 as dec(5,2) ) as HrsDiff from jrnrcvnow
Greg Craill: "Life's hard - Get a helmet !!"
Comment
-
Re: timestampdiff on V5R3
Thanks Birgitta - I had actually figured that out, but went to lunch before posting
.... But I didn't know about the overloading lark, I struggle with half loading myself, no need to go too far on these things!Greg Craill: "Life's hard - Get a helmet !!"
Comment



Comment