At 03:50 PM 11/23/2002 -0800, you wrote:
I am given the month and year. I need to figure the date of the first day of this month and the date of the last day of this month. Is there a date function that retrieves the first and last date of a particular month?
Warren, Ask and you shall receive! If the Month and Year is given, getting the first and the last day of that month is very easy, using the RDATE, ADDMON and ADDDAY functions in The Glorious R:BASE 2000 (ver 6.5++) and higher. Simple Example: -- GetFirstAndLast.RMD SET VAR vMonth INTEGER = 11 SET VAR vYear INTEGER = 2002 SET VAR vFirstDay DATE = NULL SET VAR vLastDayTemp DATE = NULL SET VAR vLastDay DATE = NULL SET VAR vFirstDay = (RDATE(.vMonth,1,.vYear)) SET VAR vLastDayTemp = (ADDMON(.vFirstDay,1)) SET VAR vLastDay = (ADDDAY(.vLastDayTemp,-1)) CLEAR ALL VARIABLES EXCEPT vFirstDay, vLastDay RETURN The resulting vFirstDay and vLastDay are the ones you need. Using above technique, you'll never have to worry about the days in a month or even the leap year! Enjoy the benefits of staying CURRENT! Very Best Regards, Razzak. P.S. Simply copy and paste above code and run at the R> prompt. Change the values for vMonth and vYear accordingly and have fun! ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l ================================================ TO SEARCH ARCHIVES: http://www.mail-archive.com/rbase-l%40sonetmail.com/
