How to substract five working days from a date

A

Anders

Hi!

When trying to customize a start field (Start3) to show
the date five working days previous to an other start
field (Start4) I can't get the same date to show.

The formula I've used in Start3 looks like this:

ProjDateSub([Start4];1860;[Task Calendar])

1860 is the duration in minutes (5 days á 6,2 hours per
day á 60 minutes per hour = 1860 minutes)

The result is the first minute of the day afterwords i.e.
if Start4 equals 2003-12-15 14:12 then Start3 will equal
2003-12-09 07:00!!! I can substract 1861 minutes and then
Start3 would equal 2003-12-08 14:11 which is better but
still not correct.

What do I do wrong? How can I accomplish this task
differently (substracting five working days from a date)?

Anyone?

Best regards!
 
R

Rod Gill

Hi,

ProjDateSub([Start4],"5d") works for me. Standard calendar would be used by
default here on a new task.

--
Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
Hi!

When trying to customize a start field (Start3) to show
the date five working days previous to an other start
field (Start4) I can't get the same date to show.

The formula I've used in Start3 looks like this:

ProjDateSub([Start4];1860;[Task Calendar])

1860 is the duration in minutes (5 days á 6,2 hours per
day á 60 minutes per hour = 1860 minutes)

The result is the first minute of the day afterwords i.e.
if Start4 equals 2003-12-15 14:12 then Start3 will equal
2003-12-09 07:00!!! I can substract 1861 minutes and then
Start3 would equal 2003-12-08 14:11 which is better but
still not correct.

What do I do wrong? How can I accomplish this task
differently (substracting five working days from a date)?

Anyone?

Best regards!
 
J

JackD

Try this:

ProjDateSub([Start4], "5d")

-Jack

Hi!

When trying to customize a start field (Start3) to show
the date five working days previous to an other start
field (Start4) I can't get the same date to show.

The formula I've used in Start3 looks like this:

ProjDateSub([Start4];1860;[Task Calendar])

1860 is the duration in minutes (5 days á 6,2 hours per
day á 60 minutes per hour = 1860 minutes)

The result is the first minute of the day afterwords i.e.
if Start4 equals 2003-12-15 14:12 then Start3 will equal
2003-12-09 07:00!!! I can substract 1861 minutes and then
Start3 would equal 2003-12-08 14:11 which is better but
still not correct.

What do I do wrong? How can I accomplish this task
differently (substracting five working days from a date)?

Anyone?

Best regards!
 
A

Anders

I still get the wrong date. It turns out that I cant get
MSP to show the last minute of the day, instead MSP jumps
to the morning the next day. I.e the formula you propose
would return 2003-12-09 07:00 instead of 2003-12-08 14:12
if Start4 equals 2003-12-15 14:12.

This is, strictly speeking, correct as the differance
between 2003-12-09 07:00 and 2003-12-15 14:12 is 5 days.
The problem is that the difference between 2003-12-08
14:12 and 2003-12-15 14:12 also is 5 days. How do I force
MSP to show this date instead?

Regards,
Anders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top