473,597 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regarding DAYOFWEEK function

Greetings,
In DB2, we have dayofweek function that returns a
numeric value for the current day (1 for sunday till 7 for saturday)

Is it possible to alter this function value, i mean 1 for monday till 7
for sunday?

Any help would be appreciated.

TIA

Jan 17 '06 #1
16 8261
pa************* **@yahoo.co.in wrote:
Greetings,
In DB2, we have dayofweek function that returns a
numeric value for the current day (1 for sunday till 7 for saturday)

Is it possible to alter this function value, i mean 1 for monday till 7
for sunday?

dayofweek_iso() :-)

--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Jan 17 '06 #2
That was easy :-). How can we set at the instance level. i mean how is
the exact implementation.

Jan 17 '06 #3
pa************* **@yahoo.co.in wrote:
That was easy :-). How can we set at the instance level. i mean how is
the exact implementation.

What's so bad about typing _ISO?
--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Jan 17 '06 #4
I am not getting. i mean how can i set it through CLP?

Jan 17 '06 #5
pa************* **@yahoo.co.in wrote:
I am not getting. i mean how can i set it through CLP?

dayofweek_iso() is a function.
Try this:
VALUES dayofweek_iso(c urrent date)

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Jan 17 '06 #6
Thanks for reply Serge, but I think i was not able to put my question
properly. If i do VALUES dayofweek_iso(c urrent date), i get the numeric
value for the current day.
What i want is , some way through which i can set today(say tue) as the
first day of the week and mon as the last day at an instance level?

Is there a way?

TIA

Jan 18 '06 #7
Ian
pa************* **@yahoo.co.in wrote:
Thanks for reply Serge, but I think i was not able to put my question
properly. If i do VALUES dayofweek_iso(c urrent date), i get the numeric
value for the current day.
What i want is , some way through which i can set today(say tue) as the
first day of the week and mon as the last day at an instance level?

Is there a way?


You can't do this at the instance level.
Jan 18 '06 #8
Thanks Ian. Can we do it at database level?

Jan 18 '06 #9
pa************* **@yahoo.co.in wrote:
Thanks Ian. Can we do it at database level?


No.

But you could always call the _ISO variation of the function and then decide
in your application which way to go. After all, you will usually convert
the numeric value to some textual name for the day, won't you?

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Jan 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10550
by: Gerben van Loon | last post by:
Hi there, hope someone can help me on this: DateTime.Now.DayOfWeek is always returning the american day names like "Monday, Saturday". Even when my CurrentCulture is set to my localized culture. I like to have my localized daynames returned. How can I do this? greets, Gerben.
4
15781
by: M | last post by:
Hello, I have code like dt.DayOfWeek.ToString(CultureInfo.CurrentCulture) where dt is a DateTime object. I get something like "Sunday", "Monday", etc... while I'm expecting it to be in French. I have a bilingual app in English and French. I don't have any problem elsewhere, like when outputting the month for example, but DayOfWeek is not working as I expected.
8
4429
by: simon | last post by:
dateTime sellDate; int16 dayOfWeek; dayOfWeek=sellDate.DayOfWeek I would like to set that monday is the first day of a week and not sunday. Any idea? In VB there is a function, where you declare which day should be the first:
0
1787
by: Harry Haller | last post by:
The context is shown below in the getGames() method. I get errors on these lines: dtGames.Rows = (TimeSpan)dtGames.Rows; dtGames.Rows = (DayOfWeek)dtGames.Rows; because the playDate column is a DateTime. Here is my solution but I don't like it. What else can I do?
5
7668
by: What-a-Tool | last post by:
Have a group of dynamically created text boxes in a calendar like grid. At the head of each column, the textbox is to contain the day of the week. Now I am using a Select Case statement to determine the day. (Yes, this is a homework assignment-it will do fine using the Select Case statement, but it seems that it would contain less code this alternative way) Col & Row are integers. If Row = 0
5
1296
by: vp | last post by:
Hi all, I have to send a file on 3rd friday of every month. Can you please let me know how to get the 3rd friday on every month using SQL
3
8309
by: Charlie Brown | last post by:
I am trying to cast a string to System.DayOfWeek. Don't even know if this is possible but it would sure save me a lot of headache if it is. Trying... Dim strDay As String = "Wednesday" Dim day As System.DayOfWeek = ctype(strDay, System.DayOfWeek)
2
4865
by: David P. Donahue | last post by:
Probably a simple question: I have a function that receives as an argument a DateTime value. One of the things I want to do is check to see if it's a weekday. So I do the following (sorry for any wrapping): if ((dateTimeStart.DayOfWeek != DateTime.DayOfWeek.Saturday) && (dateTimeStart.DayOfWeek != DateTime.DayOfWeek.Sunday)) { ...
5
1510
by: Brian S. | last post by:
Hi, I am trying to calculate the number of DayOfWeek in a month.. for instance.. this month April I want to know how many tuesdays there are in this month, this year I try to use where intDOW = FirstDayOfWeek.Tuesday dtmFirst = #4/1/2008#, dtmLast = #4/30/2008# DateDiff(DateInterval.Weekday, dtmFirst, dtmLast, intDOW) now I would think from reading.. that i would end up with 5, but i am ending
0
7962
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7884
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5844
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3880
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1229
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.