>how can I get the date for the end of the month?
>
>I want the salary receipts dated on 08/31/2009 (end of the month), eventhough I print them on the middle of the month.
d2=gomonth(d1,1)
d2=d2-day(d2)
IOW, go to the day one month ahead, then subtract that day's day-of-month number. For today, you get 5th September, -5 days takes you to 31st August.