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 » calculate week number

Post new topic  Reply to topic
 calculate week number « View previous topic :: View next topic » 
Author Message
souciance
PostPosted: Tue Jun 29, 2010 6:24 am    Post subject: calculate week number Reply with quote

Disciple

Joined: 29 Jun 2010
Posts: 169

Hello,

I would like to know if there is any way to calculate the ISO week number based on a given date using ESQL? The normal ESQL EXTRACT function does not give the ISO week number. Anyway done this before?

BR
Moeed
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jun 29, 2010 7:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What basis is the ISO week number calculated on? EXTRACT will give you weeks since January 1 or the week of the year.

CAST gives you additional options...

If none of these give the exact ISO definition, you should be off by no more than one week in a specific direction, and thus can adjust with basic arithmetic... ?
Back to top
View user's profile Send private message
souciance
PostPosted: Thu Jul 01, 2010 10:10 am    Post subject: Reply with quote

Disciple

Joined: 29 Jun 2010
Posts: 169

mqjeff, true I can use arithmetic but this seems like a bad solution for critical integrations.

Is there no way to configure the broker to use ISO date standard?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jul 01, 2010 10:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You asked very specifically about the ISO "week number".

I don't know what *ISO* thinks is the "week number", nor do I know what you think of as the "ISO week number".

Broker supports two different notions of the "week number". One is the number of weeks since January 1 of the year, and one is the number of weeks since January 1 in the year 0001. The first should never be more than 1 different from whatever ISO considers as the "week number", or may always be equal to it.

The documentation on the CAST function has a full page discussion of how to convert from datetimes to strings.

One mention in there is the discussion of the "I", and "T" as formats for a restricted profile of ISO8601. This discussion may provide some enlightenment for you in terms of the support you're looking for.

In addition, there are any number of other ways that you, as a user, can "add" support for ISO week numbers to Broker - including something as straight forward as building a JavaCompute or PHPCompute node that calls out to a date-time library that you "trust" more than you trust basic arithmetic for critical integrations.
Back to top
View user's profile Send private message
fatherjack
PostPosted: Fri Jul 02, 2010 1:55 am    Post subject: Reply with quote

Knight

Joined: 14 Apr 2010
Posts: 522
Location: Craggy Island

mqjeff wrote:
I don't know what *ISO* thinks is the "week number", nor do I know what you think of as the "ISO week number".


FYI this is what I think ISO week number is:

"a week starts on a Monday and week 1 of a given year is the one that includes the first Thursday of that year or in other words it is the week that includes 4th Jan."

HTH
_________________
Never let the facts get in the way of a good theory.
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 » calculate week number
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.