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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a number to a date

Status
Not open for further replies.

edmac2

Technical User
May 11, 2000
24
US
Crystal 6.0, I have a field {WORKORDER.REPORTDATE}and another field @Date that gives me a number. How can I add the 2 fields together to increase the {WORKORDER.REPORTDATE} by the amount of days stated in the @date field.
I tried
if {@Days} = "1" then
{WORKORDER.REPORTDATE} + 500 else
If {@Days} = "2" then
{WORKORDER.REPORTDATE} + 365 else
If {@Days} ="3" then
{WORKORDER.REPORTDATE} + 180 else
If {@Days} ="4" then
{WORKORDER.REPORTDATE} + 56 else
if {@Days} = "5" then
{WORKORDER.REPORTDATE} + 28 else
If {@Days} = "6" then
{WORKORDER.REPORTDATE} + 14 else
if {@Days} = "7" then
{WORKORDER.REPORTDATE} + 7 else
if {@Days} = "8" then
{WORKORDER.REPORTDATE} + 2 else
If {@Days} = "9" then
{WORKORDER.REPORTDATE} + 1
but the field always stays blank no matter what. TIA

 
Never mind I finally figured it out, just had to have the right fields to work with!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top