Home » SQL & PL/SQL » SQL & PL/SQL » Need Help on Oracle Function
icon9.gif  Need Help on Oracle Function [message #250027] Sat, 07 July 2007 02:08 Go to next message
steve_kc
Messages: 5
Registered: July 2007
Location: Malaysia
Junior Member

Hi,

Anyone has any idea to convert the VBA function to oracle function

Private function ()

Dim a as date

a=day 'get the day of the sedate

Select case a
Case 1, 2, 3,4,5,6
Return 1
Else
Return 0
End case
End function


Thanks in advance!!!
Re: Need Help on Oracle Function [message #250030 is a reply to message #250027] Sat, 07 July 2007 02:38 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Welcome to the board and to the world of Oracle.
This message board is all about learning, and not so much about spoonfeeding solutions, so get used to being directed to documentation instead of given an answer you can only use to solve your specific problem.
We have a sticky in the forum (first topic in the list) containing several very useful hints and links.

Now for your problem.
Oracle has a very similar way to determine the day-of-week for a certain date. Check the different format-masks of the to_char function in this doc.

To get today's date, use sysdate.

Now go and give it a try, and don't hesitate to come back when you are stuck!

Good luck.
Re: Need Help on Oracle Function [message #250033 is a reply to message #250027] Sat, 07 July 2007 03:19 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In addition to Frank post:
TO_CHAR
CASE Expressions

Beware number of a day in the week depends on your territory.

Regards
Michel
Re: Need Help on Oracle Function [message #250535 is a reply to message #250033] Tue, 10 July 2007 06:46 Go to previous message
steve_kc
Messages: 5
Registered: July 2007
Location: Malaysia
Junior Member
Thanks all. Manage to get it. Razz
Previous Topic: about variable
Next Topic: an error
Goto Forum:
  


Current Time: Thu Dec 08 02:36:17 CST 2016

Total time taken to generate the page: 0.09169 seconds