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 get day in week from CURRENT_DATE?

Post new topic  Reply to topic
 How to get day in week from CURRENT_DATE? « View previous topic :: View next topic » 
Author Message
tsuru
PostPosted: Fri Aug 04, 2006 3:49 pm    Post subject: How to get day in week from CURRENT_DATE? Reply with quote

Novice

Joined: 25 Nov 2005
Posts: 24
Location: São Paulo

Anyone knows how to get day in week from CURRENT_DATE?

I´m trying this but it returns nothing:
DECLARE dayInWeek CHAR;
SET dayInWeek = CAST(CURRENT_DATE AS CHAR FORMAT 'EEE');

Thanks
Back to top
View user's profile Send private message MSN Messenger
jbanoop
PostPosted: Sat Aug 05, 2006 12:20 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

try:
cast(current_date as char format 'e')

Regards,
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
tsuru
PostPosted: Sun Aug 06, 2006 9:13 pm    Post subject: Reply with quote

Novice

Joined: 25 Nov 2005
Posts: 24
Location: São Paulo

didn´t work. anymore ideas?
Back to top
View user's profile Send private message MSN Messenger
SKK
PostPosted: Sun Aug 06, 2006 9:24 pm    Post subject: Extract Reply with quote

Acolyte

Joined: 09 May 2005
Posts: 67

Try
EXTRACT(DAYOFWEEK FROM CURRENT_DATE);

where

Day of the week:
Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5, Friday = 6, Saturday = 7.
_________________
Regards,
SKK
Back to top
View user's profile Send private message
Nigelg
PostPosted: Mon Aug 07, 2006 1:26 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

In C, this will do it:

Code:

t = (d+=m<3?y--:y-2,23*m/9+d+4+y/4-y/100+y/400)%7; /* Sun = 0 */

_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
jbanoop
PostPosted: Mon Aug 07, 2006 1:59 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

u shld specify which version you are on ...
there is a lot of diff b/w v 5 and v 6 casts and date time manipulations..
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
tsuru
PostPosted: Mon Aug 07, 2006 1:48 pm    Post subject: Reply with quote

Novice

Joined: 25 Nov 2005
Posts: 24
Location: São Paulo

Didn´t work too.
I´m using Broker 5.0 CSD6.
Back to top
View user's profile Send private message MSN Messenger
Bill.Matthews
PostPosted: Mon Aug 07, 2006 6:19 pm    Post subject: Reply with quote

Master

Joined: 23 Sep 2003
Posts: 232
Location: IBM (Retired)

All of the suggestions mentioned above, including the Format option on a Cast - are items introduced with WMB V6.

It can be done with prior versions with some esql code.

Do a search on dayofweek - one of the entries (indicated below) includes one of my posting with sample esql code that determines the day of the week.



http://mqseries.net/phpBB2/viewtopic.php?t=7904&highlight=dayofweek&sid=f6a47344e3fef9ba712ae28c360ebd20
_________________
Bill Matthews
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 » How to get day in week from CURRENT_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.