Home » Developer & Programmer » Forms » Date Function that returns First Day of the Current month (Developer 6i, 6, Xp)
Date Function that returns First Day of the Current month [message #300053] Thu, 14 February 2008 02:07 Go to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Dear Friends,

I am looking for a date function that returns me the First Day of the current month.

Regards,
Azam Khan
Re: Date Function that returns First Day of the Current month [message #300061 is a reply to message #300053] Thu, 14 February 2008 02:29 Go to previous messageGo to next message
akramrabaya
Messages: 41
Registered: November 2007
Member


TRUNC(SYSDATE,'MONTH')


SQL> SELECT TRUNC(SYSDATE,'MONTH') FROM DUAL;

TRUNC(SYS
---------
01-FEB-08

SQL>



AKRAM
Re: Date Function that returns First Day of the Current month [message #300064 is a reply to message #300053] Thu, 14 February 2008 02:35 Go to previous messageGo to next message
akramrabaya
Messages: 41
Registered: November 2007
Member
and if u want to return the 1st day as char use this


SQL> SELECT TO_CHAR(TRUNC(SYSDATE,'MONTH'),'DAY') FROM DUAL;

TO_CHAR(T
---------
FRIDAY

SQL>




akram
Re: Date Function that returns First Day of the Current month [message #300070 is a reply to message #300061] Thu, 14 February 2008 02:57 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Dear Akram,

Frist of all thanks for your reply. My problem is solved. Can you me one more thing is there any date function that returns the last date of the current month.

Regards,
Azam Khan
Re: Date Function that returns First Day of the Current month [message #300071 is a reply to message #300064] Thu, 14 February 2008 03:07 Go to previous messageGo to next message
akramrabaya
Messages: 41
Registered: November 2007
Member


SQL> SELECT last_day(SYSDATE) , TO_CHAR(last_day(SYSDATE),'day') from dual;

LAST_DAY( TO_CHAR(L
--------- ---------
29-FEB-08 friday

SQL>



akram
Re: Date Function that returns First Day of the Current month [message #300073 is a reply to message #300071] Thu, 14 February 2008 03:14 Go to previous message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Dear Friend Akram,

Thanksssss... alot

Actually I m making a calender in Developer for general use. I m not good with active X control thats why I m trying to do it in developer.

Regards,
Azam Khan
Previous Topic: Saving to an Excel file using forms
Next Topic: How to change font color & font size at runtime
Goto Forum:
  


Current Time: Fri Sep 27 08:21:22 CDT 2024