Joined: 30 May 2007
Location: United States
Online Status: Offline
Posts: 1
Topic: Help with a Date Formula Posted: 30 May 2007 at 12:00pm
I have been trying to make a formula that will take a date field and display the last date of the month but can't get it to work and am getting very frustrated.
For example, if the date field is 05/25/2007 I want the formula to display 5/31/2007.
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 30 May 2007 at 2:17pm
I think there is a better formula than this one, but it escapes me rght now. Sorry.
//Get the first day of the next month x := DateAdd("m",1,Date(Year(field),Month(field),1)); //Subract one day from it. x := DateAdd("d", -1, x);
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum