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

DateVar Formula

Status
Not open for further replies.

donnarenia

Technical User
May 28, 2010
41
US
I am trying to write a report that will calculate a deadline date based on the actual start date of a project and end date of a project.

This is what I currently have

datevar x := {PROJECT.StartDate};
datevar y := {PROJECT.FinishDate};
datevar lastday := dateserial(year(y),month(y)+1,+20);

but all it does not give me the information I need, it adds 20 days to my finishdate.

Can anyone help me find useful DateVar formulas to calculate days?

Thanks in advance
 

I'm not clear on what you need to do - what will the final result be for a specific set of dates?

 
The result should be a deadline date that is 20 days from the StartDate. I can calculate the difference in the StartDate and FinishDate but I need to see the actual date that is 20 days from the StartDate.

I hope this helps clarify my question.

Thanks in advance
 
Use:

dateadd("d",20,{PROJECT.StartDate})

Or you could even use just:

{PROJECT.StartDate}+20

-LB
 
Thanks...It was that simple. I was way overthinking it with the variables....Thanks so much.
 
Would I use variables or just a if then statement to accomplish the following:

I have a list of projects and each project has a start date and a finish date if it is an accounting project, if itis a Tax project it has a Statutory Date. I want to determine a Deadline date for accounting projects 10 days prior to the finish date and a deadline date for tax projects 10 days before the Statutory Due Date.

I created this if then statement but not receiving the correct results:

if {PROJECT.Completed} = "F" then {PROJECT.StatutoryDueDate} - 10 else {PROJECT.FinishDate}- 10

Any assistance will be greatly appreciated. Thanks
 
Why would you be using a field called "project.completed" to make the distinction? You would need the field that tells you whether a project is accounting or tax. So what is that field, and what are the possible results for that field?

-LB
 
You are correct and after troubleshooting, I did use the following formula and got the correct results

if {PROJCUS.~Custom5} = "Tax" then {PROJECT.StatutoryDueDate} - 10 else {PROJECT.FinishDate}- 10

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top