Find the last day of the month
Moderators: chulett, rschirm, roy
Find the last day of the month
Hi ,
Can anyone help me to find out the DS function to find the last day of the given month.i have one function called month.last from the built in transforms. so this will give me the internal format for the last day of the month whch i have supplied in the format yyyy-mm. Example: MONTH.LAST("1993-02") => 9191,
where 9191 is the internal representation of February 28, 1993...now i need a oconv function to convert this 9191 and get the date only.....can anyone help ...Thanks in advance
Can anyone help me to find out the DS function to find the last day of the given month.i have one function called month.last from the built in transforms. so this will give me the internal format for the last day of the month whch i have supplied in the format yyyy-mm. Example: MONTH.LAST("1993-02") => 9191,
where 9191 is the internal representation of February 28, 1993...now i need a oconv function to convert this 9191 and get the date only.....can anyone help ...Thanks in advance
Hint: Get the first day of the following month in internal format, then subtract one from it to get the last day of the prior month.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
The internal date of the last day of the month of February 2008 is . You didn't specify if you wanted a full date, a day-of-the-week, a day-number in month or another format as output so I can't suggest any OCONV() function to use, but all the options are well-documented in the BASIC Programmer's Guide
Code: Select all
ICONV('2008-03-01","D4-YMD[4,2,2]")-1
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
sir,ArndW wrote:The internal date of the last day of the month of February 2008 is. You didn't specify if you wanted a full date, a day-of-the-week, a day-number in month or another format as output so I can't suggest any OCONV() function to use, but all the options are well-documented in the BASIC Programmer's GuideCode: Select all
ICONV('2008-03-01","D4-YMD[4,2,2]")-1
My requirement is to check whether the date which i receive in a business date column is the last day of that particular month specified in the data.
For ex if i get a January month data , then the business date must be 31-01-2008..... so i need to check whether the given date is last date of the month jan and so on for other months also........so i was trying to figure out some solution for this.....can you kindly help
If "OCONV(ICONV(YourDate,YourDateFormat)+1,'DD')=1" then YourDate is the last day of the month.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Sir,ArndW wrote:If "OCONV(ICONV(YourDate,YourDateFormat)+1,'DD')=1" then YourDate is the last day of the month. ...
I tried this "OCONV(ICONV(YourDate,yyyymmdd)+1,'DD')=1" then the output is 1 and when i try with -1 then it is 30 ,,,and even when i change my month to Aug and with -1 it still gives 30...Afraid the code is not working properly......kindly help
Hi
You are right Chulet , i missed a step in my job.
I convert a date to YOURDATE with
then i place this constraint to select the rows i want
You are right Chulet , i missed a step in my job.
I convert a date to YOURDATE with
Code: Select all
Oconv(de_table_pce.D_TRAITEMENT,"D/DMY[2,2,4]")
Code: Select all
de_table_pce.D_TRAITEMENT=MONTH.LAST(YOURDATE [7,4]:'-':YOURDATE [4,2])
Hope This Helps
Regards
Regards