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 » Calculating age

Post new topic  Reply to topic
 Calculating age « View previous topic :: View next topic » 
Author Message
EnOne
PostPosted: Tue Apr 13, 2004 7:42 am    Post subject: Calculating age Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 100
Location: Kansas City

I am using WebSphere MQ Integrator V2.1 . I thought I could calculate age by subtracting birthdate from current date.

DECLARE Birth DATE;
DECLARE Age INTEGER;

SET Birth = 1923-08-25;
SET Age = CAST((CURRENT_DATE - Birth) YEAR AS INTEGER)

-----RESULT
<Birth>1923-08-25</Birth>
<CURRENT_DATE>2004-04-13</CURRENT_DATE>
<Age>81</Age>

By my calculations, this person would not be 81 until 2004-08-25. Is there a way to calculate age without having MQ round up? I realize I could just calculate the number of days then divide by 365.25 and truncate but this feels like a bad workaround. How do other people calculate age?
Back to top
View user's profile Send private message
basva
PostPosted: Wed Apr 14, 2004 7:48 am    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2002
Posts: 39

In You ESQL try using FLOOR function.
Back to top
View user's profile Send private message
Lisa
PostPosted: Wed Apr 14, 2004 7:55 am    Post subject: Date Reply with quote

Master

Joined: 07 Jun 2002
Posts: 287
Location: NJ

Hi,
Take a look at the Interval function in the ESQL manual.

Lisa
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

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