I need to calculate the elapsed time between two transactions. I have the times but I get error whe I try to substract them. I have created a new class in the designer with string type for my time. I got the time as string try to substring the hour , the minutes and the seconds, I am able to perform some operations but I guess this is deadend…
If any one has worked on this issue please give me some clues how to tackle this…
What DBMS (Oracle, IBM DB2, etc.) are you using?
Can’t you do the calculation at the universe or DB level instead?
Passing time and/or dates as STRINGS/CHARACTER is ususally not a good idea, because then you loose the correct sorting and cannot easily do time difference calculation IMHO.
Also, if you do a search on BOB there has been a thread with a formula how to calculate time differences within BO Reporter (down to the second).
Thanks a lot for the approach… finally I also came to this … converting everything in hours , substracting them and converting the result again in hours . min and sec…
I was hoping for a simpler solution but I guess that is the way …
I guess you are working with ORACLE? In DB2 there is the TIMESTAMPDIFF function one can put to use in the universe to calculate the time difference between 2 timestamps. My guess is that a user defined function should be possible.
An example:
That should enable calculations outside the report, at the DB level…
Remember: in the link I gave you Ken Gaul has written a DLL that you can add to BO, which will add a new BO Reporter function to calculate date/time differences.
That may be a suitable solution , but would a function at database level not be more generic? Locally adding DLL’s may work fine technically, but having solution through the DP would be a lot easier to support and maintain…