Month End Date (UDF)

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Dutch
Posts: 57
Joined: Tue Oct 10, 2017 12:44 pm

Month End Date (UDF)

Post by Dutch » Mon Jan 23, 2006 7:34 am

Dear All,____I try to use UDF for finding month end date. but the problem is I cannot know the date format of each computer. I do as following but it work for some computer and don^t work in other computer.____M_End(d_in) // it works for computer use date format mm/dd/yyyy__========__Expression__------------__ctod( subs(dtoc(in+iif(day(in)>15,20,35),1) ,5,2)+^/01/^+subs(dtoc(in+iif(day(in)>15,20,35),1) ,1,4) ) -1 ____- How can I use one function with any date format? __- Have it got STOD( date char YYYYMMDD ) to Date ?____Thanks in advance,__Dutch

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Month End Date (UDF)

Post by kfleming » Mon Jan 23, 2006 8:34 am

Try this UDF declaration and expression:____LMon(d_date)__adddays(date,monlen(date)-day(date))____When you pass it a date it returns the last day of the month for that date.____Kathleen__R&R Support

Dutch
Posts: 57
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Month End Date (UDF)

Post by Dutch » Mon Jan 23, 2006 8:40 am

Thanks, it works great.__Dutch

Post Reply