Author |
Message
|
bobbee |
Posted: Wed Oct 05, 2011 3:57 pm Post subject: Time Calculation |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
I have two type TIME fields:
CheckAtTime = 17:49:07.281
EndTime 17:49:17.280
I am issuing this ESQL and get noting in the result field
SET Env.Timer.TimeLeft = (Env.Timer.EndTime - CheckAtTime) SECOND;I would have expected 10.x as a result. I am getting a NULL. |
|
Back to top |
|
 |
kash3338 |
Posted: Wed Oct 05, 2011 6:48 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Store the two values in a TIME variable and then subtract. Also check the use of INTERVAL function. |
|
Back to top |
|
 |
bobbee |
Posted: Wed Oct 05, 2011 7:33 pm Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
so I go back and try what you suggeted, Nothing changed. SO now I start changing the types that I am storing the result value in. When I hit CHAR this is what I got:
INTERVAL '9.999306' SECOND
So I go back and read and it does say string. So now I have to parse as I need the seconds in a usable form. What a SCRED up way of presenting a value that the go through alot of trouble to be specifically LEGAL about the output type when playing with mixtures of arithmetic on time values. I mean, come on. It's seconds, why would I want a string with descriptive characters in the result.
Well, on we move. |
|
Back to top |
|
 |
j.f.sorge |
Posted: Wed Oct 05, 2011 8:36 pm Post subject: Re: Time Calculation |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
bobbee wrote: |
SET Env.Timer.TimeLeft = (Env.Timer.EndTime - CheckAtTime) SECOND;I would have expected 10.x as a result. I am getting a NULL. |
Did you check the result within the debugger?! Then you probably have the same behaviour I had. The debugger always shows NULL but if you use your INTERVAL variable within your ESQL code everything works fine. _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
bobbee |
Posted: Thu Oct 06, 2011 4:23 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
really???? that is amazing. Will check, tnx!!!!!!! |
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 06, 2011 4:45 am Post subject: Re: Time Calculation |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
j.f.sorge wrote: |
bobbee wrote: |
SET Env.Timer.TimeLeft = (Env.Timer.EndTime - CheckAtTime) SECOND;I would have expected 10.x as a result. I am getting a NULL. |
Did you check the result within the debugger?! Then you probably have the same behaviour I had. The debugger always shows NULL but if you use your INTERVAL variable within your ESQL code everything works fine. |
The debugger claims another victim....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bobbee |
Posted: Thu Oct 06, 2011 5:45 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
dumped the data in a TRACE node. It was not there in the debugger but it sure showwed up in the TRACE. Thanks!!!!!!!!! |
|
Back to top |
|
 |
|