Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Formula Help Needed

Status
Not open for further replies.

hlecover

IS-IT--Management
Sep 3, 2003
2
US
I need help writing a date add formula in Crystal as follows for due dates on invoices:

Assume invoice date is 11/25. The due date is the date+60 days and then the last day of month. In this example, the due date would be January 31. Same thing for 45 and 90 days.

The other situation is that the due date is the 10th of the following month after 90 days. For example, 90 days after November 24 is February 24, so the due date would be March 10.

Thanks in advance!
 
Create a parameter {?Days}, and then create a formula:

datevar x := {table.invoicedate};
datevar y := dateadd("d",{?Days},x);
datevar lastday := dateserial(year(y),month(y)+1,1)-1;

For your other situation, you could use:
datevar x := {table.invoicedate};
datevar y := dateadd("d",90,x);
datevar lastday := dateserial(year(y),month(y)+1,10);

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top