ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to extract the hour from the interval result

Post new topic  Reply to topic
 How to extract the hour from the interval result « View previous topic :: View next topic » 
Author Message
AlexeiSkate
PostPosted: Thu Aug 22, 2002 1:31 pm    Post subject: How to extract the hour from the interval result Reply with quote

Centurion

Joined: 10 Apr 2002
Posts: 123

Hello,

I've calculated the time interval between two timestamps with the following ESQL:

DECLARE intvHour INTERVAL;
SET intvHour=( CAST(CURRENT_TIMESTAMP AS TIMESTAMP) - CAST(Environment.Variables.Query.MellonFiles[i].FILE_STATUS_DATE AS TIMESTAMP)) HOUR;

The result is [INTERVAL INTERVAL '75' HOUR ]. Is there an easy way to extract just the 75 from the interval result ? Thanks.

- Alex
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Aug 22, 2002 2:13 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Alex,

Use CAST function...
Code:

DECLARE intvHour INT;
SET intvHour= CAST(((CAST(CURRENT_TIMESTAMP AS TIMESTAMP) - CAST(Environment.Variables.Query.MellonFiles[i].FILE_STATUS_DATE AS TIMESTAMP)) HOUR ) AS INT);

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
AlexeiSkate
PostPosted: Thu Aug 22, 2002 2:26 pm    Post subject: Reply with quote

Centurion

Joined: 10 Apr 2002
Posts: 123

Thanks Kirani. I wish my company could have hired you as a consultant
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Aug 22, 2002 2:45 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

may be next time!
oh .. BTW ... my name is Kiran, kirani is my login name
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to extract the hour from the interval result
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.