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

status of the project and number of days (overdue) 1

Status
Not open for further replies.

Cores

Programmer
Oct 17, 2007
92
CA
CRXI
The report has a field proj_due_date.

We need to define status of the project
and number of days (overdue) that past proj_due_date

Status
If more than 20 days between current date and proj_due_date then status is ‘In Development’
If less than 20 days between current date and proj_due_date then status is ‘Anticipated’
If current date past proj_due_date then status is ‘Late’.


Give me please an idea how to make it?
Thank you!
 
Make your description into a formula

@Status
If datediff("d",currentdate, {proj_due_date}) >= 20 then 'In Development'
else
If datediff("d",currentdate, {proj_due_date}) < 20 then 'Anticipated'
If currentdate > {past proj_due_date} then 'Late'

CurrentDate is a Crystal function.

Ian
 


WhilePrintingRecords;

If DateDiff("d", {project_due_date}, CurrentDate) >= 20 then 'In Development'

else if DateDiff("d", {project_due_date}, CurrentDate) < 20 then 'Anticipated'

else if CurrentDate > {project_due_date} then 'Late'


hope this helps
 
Thanks very much to both of you.

So, for calculating number of overdue days I can use datediff function. But how can I make sure that this number is overdue and not still anticipated number of days?

thanks
 
Ian's should be:

//@Status
If currentdate > {past proj_due_date} then 'Late' else
If datediff("d",currentdate, {proj_due_date}) >= 20 then 'In Development'
else
If datediff("d",currentdate, {proj_due_date}) < 20 then 'Anticipated'

...since if the due date is past, the datediff would return a negative--which would be < 20 and result in "Anticipated".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top