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

Relative vs. absolute time/date in MS Project

Status
Not open for further replies.

greggp

IS-IT--Management
Mar 22, 2001
16
0
0
US
Is it possible to display relative dates in the 'Start Date' column?

I've only seen absolute dates displayed.

For example, if a task were to start on Aug. 1st., and there are successor tasks that were to follow with a week lag... they show a start date of Aug. 7th. I'd like to display a start date of something like '+ 1 week'.

Does anyone know if this is possible?
 
Greg

Pretty sure you can't do that in the spreadsheet part - at least, not as described. But you can format the Gant chart timescale as Week 1, Week 2. You can also format the dates as W01, W02 etc, but these are weeks of the year (do this through Tools, Options, View. If you started your project on 1st January, I think you'd get pretty close to what you're after....

HTH

Ben
 
Greg,

Assume that your task that starts on August 1 is Task 5.
Also assume that the successor task is task 6.
Assume that the start of task 6 is 5 days (work days) after the start of task 5.
Also assume that you are using 'days' as the period for calculations

In the task 6 predecessor field in your chart enter 5ss+5 // or // 5ss5

The formula is explained thus (start of Task 6 to start 5 days after task 5 starts

you can vary the start of the successor task (6) to be any time after the start of the predecessor task (5), by changing the number after the + sign. Note: you can leave the + sign off, as the formula will calculate using 'positive numbers.
 
I think you misunderstood my question.

I'm not trying to set a start-to-start lag... (by the way -- there are easier techniques for setting start lags)

I'm trying to display the units of the start date column with a relative date. My only choices for formating this column are absolute unless I want dates relative to the 1st calender week as explained in the previous post.
 
Greg

Been worrying about this one. The following code is neither elegant nor fully tested, but it might help: it puts a relative date (relative to the latest predecessor date) into the Text1 column. Let me know if it's any help - or if it doesn't work - at all.

Sub calculateFields()
Dim p As Project
Dim acts As Tasks
Dim act As Task
Dim pred As Task
Dim latedate As Date
Dim strpred As String
Dim sp As String
Dim i As Integer

Set p = Application.ActiveProject
Set acts = p.Tasks


For Each act In acts
strpred = act.Predecessors
If Len(strpred) = 0 Then latedate = act.Start
Do Until Len(strpred) = 0
i = InStr(strpred, ",")
If i > 0 Then
sp = Left(strpred, i - 1)
Else
sp = strpred
Exit Do
End If
strpred = Mid(strpred, i + 1)
Set pred = p.Tasks(Val(sp))
latedate = pred.Finish
If latedate < pred.Finish Then latedate = pred.Finish 'Else latedate = act.Start
Loop
act.Text1 = &quot;+&quot; & ((act.Start - latedate) \ 7) & &quot; week&quot;
Next act
End Sub

Cheers

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top