•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Oracle section within the Web Development category of DaniWeb, a massive community of 426,517 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,081 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Oracle advertiser: Programming Forums
Views: 783 | Replies: 1
![]() |
•
•
Join Date: Jul 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I am a junior dev. and I need help on some select statements on a Oracle db.
First I needed to get all the months of the year in 'MON' format and I did it like this:
Now, I need another statements to get only the month that have 31 days, then 30 days the leap year.
I cannot create strings that have the names like JANFEBMAR.. and then compare because we use this in a multilingual environment.
Any help would be appreciate it.
I am a junior dev. and I need help on some select statements on a Oracle db.
First I needed to get all the months of the year in 'MON' format and I did it like this:
sql Syntax (Toggle Plain Text)
SELECT DISTINCT TO_CHAR(dt,'MON') MONTH FROM ( SELECT TRUNC(SYSDATE,'y')-1+ROWNUM dt FROM all_objects WHERE ROWNUM <= 366) ORDER BY TO_DATE( MONTH, 'MON' )
Now, I need another statements to get only the month that have 31 days, then 30 days the leap year.
I cannot create strings that have the names like JANFEBMAR.. and then compare because we use this in a multilingual environment.
Any help would be appreciate it.
Last edited by peter_budo : Jul 23rd, 2008 at 7:11 pm. Reason: Keep It Organized - please use [code] tags
•
•
Join Date: Apr 2008
Posts: 295
Reputation:
Rep Power: 1
Solved Threads: 41
Hi,
you may try:
krs,
tesu
you may try:
sql Syntax (Toggle Plain Text)
SELECT * FROM yourtable WHERE TO_CHAR(your_date, 'MM') IN ('01', '03',... ,'12')
krs,
tesu
Last edited by peter_budo : Jul 26th, 2008 at 4:11 pm. Reason: Keep It Organized - please use [code] tags
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Oracle Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Error message when attempting to run program in Windows XP (Windows NT / 2000 / XP / 2003)
- convert seconds to minutes, hours, days, months, years, etc. (C)
- array structs, size swap functions, the amount of days between to dates (C++)
- The World's Youngest IBM Certified J2EE Developer. (Java)
- Logic to Convert Days From 1800 to a Date (Month, Day, Year) (C++)
- daniweb down for two or three days. (Geeks' Lounge)
- JoeOneEye- prosearching.com problem (Viruses, Spyware and other Nasties)
- Contest Windows Up Time (Windows NT / 2000 / XP / 2003)
- Delete Old Posts? (DaniWeb Community Feedback)
Other Threads in the Oracle Forum
- Previous Thread: Oracle Server Version
- Next Thread: Database driver and provider


Linear Mode