DATE CONVERSION [message #22823] |
Thu, 31 October 2002 01:33 |
jasn
Messages: 39 Registered: October 2002
|
Member |
|
|
hOW CAMN I CALCULATE DAYS FROM THE START OF MONTH TO THE CURRENT DATE(SYSDATE)
PL HELP!
|
|
|
Re: DATE CONVERSION [message #22824 is a reply to message #22823] |
Thu, 31 October 2002 05:45 |
gp
Messages: 46 Registered: September 2002
|
Member |
|
|
hey can u put your question more clearly cos if u r looking for no of days isnt it that the date is enough cos if its 39 th today then naturally there were 29 days since start of month !!!
is it that u want to calculate from some old date or month say 1stdec 99 to today ????
|
|
|
|
Re: DATE CONVERSION [message #22830 is a reply to message #22823] |
Thu, 31 October 2002 09:38 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
As gp mentions, I think the easiest way is just:
sql>select to_char(sysdate, 'dd') dm from dual;
DM
--
31
No subtraction required.
|
|
|
Re: DATE CONVERSION [message #22838 is a reply to message #22823] |
Thu, 31 October 2002 22:13 |
jasn
Messages: 39 Registered: October 2002
|
Member |
|
|
You rightly understood. Muy problem is to calculate next salary if an employee gets two or three advance salaries. Then he should be paid after due date. i want to calculate that due date.
thanx
|
|
|
Re: DATE CONVERSION [message #22843 is a reply to message #22838] |
Fri, 01 November 2002 01:48 |
gp
Messages: 46 Registered: September 2002
|
Member |
|
|
select sysdate,
last_daY(add_months('01-Jun-2002',-1)) +1,
sysdate-(last_daY(add_months('01-Jun-2002',-1))+1) days from dual
this should help as you need the salry from the 1st of each month you can replace hard coded date from the user in put.... i guess my solution is similar to the one proposed by someo one else also...
|
|
|