Home » SQL & PL/SQL » SQL & PL/SQL » get number of week day - no matter what national locale is used (Oracle 11.2.0.1.0)
get number of week day - no matter what national locale is used [message #621710] Sat, 16 August 2014 11:26 Go to next message
ecivgamer
Messages: 145
Registered: May 2011
Location: Ukraine
Senior Member
Hi all,

My need is to get number of week day - no matter what national locale is used.
For example, Saturday is 6th day of week in my country, because week starts from Monday.
I've heard that some countries start week from Sunday.
So my need is to compile code that doesn't depend on national locale.
How do I perform it?


Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE 11.2.0.1.0 Production"
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Re: get number of week day - no matter what national locale is used [message #621712 is a reply to message #621710] Sat, 16 August 2014 11:39 Go to previous message
ecivgamer
Messages: 145
Registered: May 2011
Location: Ukraine
Senior Member
The solution:

SELECT 1 + TRUNC (SYSDATE) - TRUNC (SYSDATE, 'IW') T1 FROM DUAL
Previous Topic: loading table from excel without using util
Next Topic: get hour value from sysdate in 24 hour format
Goto Forum:
  


Current Time: Wed Dec 17 17:10:11 CST 2014

Total time taken to generate the page: 0.05683 seconds