Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Date Formula Post Reply Post New Topic
Author Message
hlecover
Newbie
Newbie


Joined: 24 Nov 2009
Location: United States
Online Status: Offline
Posts: 4
Quote hlecover Replybullet Topic: Date Formula
    Posted: 24 Nov 2009 at 4:00pm
I need to display in a report due dates of invoices. The formula that I need is to use a date, add 45,60, or 90 days, and the due date is the end of that month (after adding the days.) For example, 60 days from Nov 24 is January 24, so the due date that should be returned by the formula is January 31.

Another term that needs to be accounted for is adding 90 days to the date, and the due date will be the next 10th of the next month. For example, date is November 24, adding 90 days gets February 24, so the due date would be March 10.
 
Thanks in advance for any help! 
Howard
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Nov 2009 at 8:18am
45 Days:
Dateadd('d',-(DAY(dateadd('m',1,dateadd('d',45,Datefield)))),dateadd('m',1,dateadd('d',45,Datefield)))
 
60 Days:
Dateadd('d',-(DAY(dateadd('m',1,dateadd('d',60,Datefield)))),dateadd('m',1,dateadd('d',60,Datefield)))
 
90 Days:
Dateadd('d',(-(DAY(dateadd('m',1,dateadd('d',90,Datefield))))+10),dateadd('m',1,dateadd('d',90,Datefield)))
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.027 seconds.