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 » Subtracting Timestamps

Post new topic  Reply to topic
 Subtracting Timestamps « View previous topic :: View next topic » 
Author Message
andrewl68
PostPosted: Thu Oct 16, 2003 4:39 am    Post subject: Subtracting Timestamps Reply with quote

Novice

Joined: 23 Sep 2003
Posts: 14

I am trying to get the interval in days between two timestamps. I have included my code below. I am getting an error requesting an interval qualifier. I am sure it is my syntax.... any help would be appreciated.

DECLARE SCRATCHDATE TIMESTAMP;
DECLARE SCRATCHDATE2 TIMESTAMP;
DECLARE SCRATCHTIME CHAR;
DECLARE INDATE TIMESTAMP;

DECLARE TIMEDIFF INTERVAL;
DECLARE TIMEDIFF2 INTERVAL;

SET SCRATCHDATE = CURRENT_DATE;


SET T = 1;

WHILE T <= S DO

IF ("InputBody"."TSYS_CRDRIN_LICI"[T]."DateLastCardRequest") <> '0000000' THEN
SET SCRATCHTIME = SUBSTRING("InputBody"."TSYS_CRDRIN_LICI"."TimeLastCardRequest" FROM 1 FOR 2) || ':'
|| SUBSTRING("InputBody"."TSYS_CRDRIN_LICI"."TimeLastCardRequest" FROM 3 FOR 2)|| ':'
|| '01';
SET INDATE = (CONVERTDATE("InputBody"."TSYS_CRDRIN_LICI"[T]."DateLastCardRequest") || ' ' || SCRATCHTIME);
SET TIMEDIFF = CAST((SCRATCHDATE - INDATE) AS INTERVAL DAY);
END IF;
SET T = T + 1;


END WHILE;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Subtracting Timestamps
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.