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 » Subtract one day from given Date.

Post new topic  Reply to topic
 Subtract one day from given Date. « View previous topic :: View next topic » 
Author Message
venky
PostPosted: Fri Feb 27, 2004 1:32 pm    Post subject: Subtract one day from given Date. Reply with quote

Master

Joined: 08 Jul 2003
Posts: 205

Hi All,

I have to subtract one day from a given date.
My date is stored in Environment Variable.

And My code is:
(CAST(Environment.Variables.PO_LINE[I].PCDATA[Env_Cntr +
1].pc_start AS DATE) - 1);

My Date is stored in the Environment Variable in the format:
pc_start = TIMESTAMP '2004-02-18 00:00:00'

It errors Out.

Pls Help.

Thanks,
Venky
--
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Feb 27, 2004 1:37 pm    Post subject: Reply with quote

Jedi Knight

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

Try using INTERVAL data type.
Also, if you do a search in this forum for INTERVAL and you can find related post with some sample code.
_________________
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
Missam
PostPosted: Fri Feb 27, 2004 1:40 pm    Post subject: Reply with quote

Chevalier

Joined: 16 Oct 2003
Posts: 424

Why don't you try this

CAST(Environment.Variables.PO_LINE[I].PCDATA[Env_Cntr +
1].pc_start AS DATE) - INTERVAL '1' DAY);
Back to top
View user's profile Send private message
venky
PostPosted: Fri Feb 27, 2004 2:12 pm    Post subject: Reply with quote

Master

Joined: 08 Jul 2003
Posts: 205

HI Kirani and IamSam,

I got it working with the syntax you guys gave.
Thanks for your help.

Thanks,
Venky
--
Back to top
View user's profile Send private message
Missam
PostPosted: Fri Feb 27, 2004 3:03 pm    Post subject: Reply with quote

Chevalier

Joined: 16 Oct 2003
Posts: 424

Try this

CAST(Environment.Variables.PO_LINE[I].PCDATA[Env_Cntr +
1].pc_start AS TIMESTAMP) - INTERVAL '1' DAY);

change cast type date to timestamp,it should work
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 » Subtract one day from given Date.
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.