Home » Developer & Programmer » Forms » help needed
icon2.gif  help needed [message #202516] Fri, 10 November 2006 03:00 Go to next message
chmlaeeque
Messages: 59
Registered: September 2006
Member
hi everyone,
can anyone plz tell me that how can we check the total days (e.g 30, 31 or 28 ) of the months we entered or capture the month of system date.
i want to create query that if month has 30 days then do this else do this
thanx
Re: help needed [message #202518 is a reply to message #202516] Fri, 10 November 2006 03:13 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Using the LAST_DAY function. For example,
SQL> select to_number(to_char(last_day(sysdate), 'dd')) ld from dual;

        LD
----------
        30

SQL>
Re: help needed [message #202521 is a reply to message #202518] Fri, 10 November 2006 03:24 Go to previous messageGo to next message
chmlaeeque
Messages: 59
Registered: September 2006
Member
thanx little foot thanx
Re: help needed [message #202534 is a reply to message #202516] Fri, 10 November 2006 04:16 Go to previous message
shahidmughal
Messages: 91
Registered: January 2006
Location: Faisalabad Pakistan
Member

hi
following is the solution of your problem
put the result in a variable and then
do any thing to that variable.


1* SELECT TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE),'DD')) AS DAYS_PER_MONTH,SYSDATE TODAY FROM DUAL

result

DAYS_PER_MONTH TODAY
-------------- ---------
30 10-NOV-06


regards

Muhammad Shahid Mughal
Faisalabad Pakistan
Previous Topic: how to built a dynamic sql
Next Topic: bind variable
Goto Forum:
  


Current Time: Fri Sep 20 13:50:10 CDT 2024