×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Be sure this function as available at your OS release level -

Adam Glauser wrote:
Jeff Young wrote:
The problem I am having is that the system is not finding the TIMESTAMPDIFF built in function in SQL.

I don't use straight SQL much (we have SEQUEL here), but I thought that getting the parameters right might help. Some languages identify functions by name _and_ parameter list in order to support overloading.

It seems I was both wrong and right. My first suggestion does not work on my system with a "timestampdiff not found" error:
select timestampdiff(2,timestamp('2008-10-10','10:10:10')-timestamp('2008-10-09','10:10:10'))
from sysibm.sysdummy1

This however does work:
select timestampdiff(2,cast(timestamp('2008-10-10','10:10:10')-timestamp('2008-10-09','10:10:10') as char(22)))
from sysibm.sysdummy1

The example in the documentation shows that the result of the timestamp difference as to be cast to character for TIMESTAMPDIFF.

HTH,
Adam

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.