DateDiff function is not working for me

S

Steve Scott

I am using DateDiff to find the interval between two dates. But it is
producing an error message in the column. Can anyone explain under what
circumstances would DateDiff not work??
 
J

JulieD

Hi steve

what is the actual formula you are using as it seems to work fine for me.

Cheers
JulieD
 
J

JulieS

Hi Steve,
Can you give us more information please? What custom field are you entering
in the DateDiff function? What formula have you tried?

Julie
 
J

JackD

If you are using it to check between something like [start] and [baseline
start] where you have not yet set a baseline, then you will get an error.

If you post your formula then it is much easier to understand what you are
doing wrong.
 
M

Mike Glen

Hi JulieD,

I've been trying to email you but your address is not recognized. Could you
email me please?


Mike Glen
Project MVP
 
J

JulieS

Hi Steve,

Try this formula in one of the spare Number fields:

IIf([Finish1]=ProjDateValue("NA"),0,DateDiff("d",[Finish],[Finish1]))

Hope this helps. Let us know how you get along.
Julie

Steve Scott said:
Formula is:-

Date1= DateDiff("dd",[Finish],[Finish1])

JulieD said:
Hi steve

what is the actual formula you are using as it seems to work fine for me.

Cheers
JulieD
 
J

JulieD

Hi Steve

i think the problem is that you're using a date field (Date1) to store a
number in (the number of days between finish & finish1) - use a number field
instead.

Cheers
JulieD


Steve Scott said:
Formula is:-

Date1= DateDiff("dd",[Finish],[Finish1])

JulieD said:
Hi steve

what is the actual formula you are using as it seems to work fine for me.

Cheers
JulieD
 
J

JackD

Aside from what others have told you about not using a date field for
holding a number, your formula should NOT include the = sign or anything to
the left of it.

--
-Jack ... For project information and macro examples visit
http://masamiki.com/project

..
Steve Scott said:
Formula is:-

Date1= DateDiff("dd",[Finish],[Finish1])

JulieD said:
Hi steve

what is the actual formula you are using as it seems to work fine for me.

Cheers
JulieD
 
S

Steve Scott

Thanks Julie this worked, however what is the purpose of the first part of
the formula ie IIf([Finish1]=ProjDateValue("NA"),0

JulieS said:
Hi Steve,

Try this formula in one of the spare Number fields:

IIf([Finish1]=ProjDateValue("NA"),0,DateDiff("d",[Finish],[Finish1]))

Hope this helps. Let us know how you get along.
Julie

Steve Scott said:
Formula is:-

Date1= DateDiff("dd",[Finish],[Finish1])

JulieD said:
Hi steve

what is the actual formula you are using as it seems to work fine for me.

Cheers
JulieD

I am using DateDiff to find the interval between two dates. But it is
producing an error message in the column. Can anyone explain under what
circumstances would DateDiff not work??
 
J

JulieD

Hi Steve

This checks to see if Finish1 has an actual date in it or the words "NA" ...
if it has the words "NA" then it returns 0 as an answer ... otherwise it
calcs the datedif function.

Hope this helps
JulieD
(the other Julie)

Steve Scott said:
Thanks Julie this worked, however what is the purpose of the first part of
the formula ie IIf([Finish1]=ProjDateValue("NA"),0

JulieS said:
Hi Steve,

Try this formula in one of the spare Number fields:

IIf([Finish1]=ProjDateValue("NA"),0,DateDiff("d",[Finish],[Finish1]))

Hope this helps. Let us know how you get along.
Julie

Steve Scott said:
Formula is:-

Date1= DateDiff("dd",[Finish],[Finish1])

:

Hi steve

what is the actual formula you are using as it seems to work fine for
me.

Cheers
JulieD

I am using DateDiff to find the interval between two dates. But it
is
producing an error message in the column. Can anyone explain under
what
circumstances would DateDiff not work??
 
J

JulieS

Thanks JulieD.
JulieS
(the other "other" Julie)

JulieD said:
Hi Steve

This checks to see if Finish1 has an actual date in it or the words "NA" ...
if it has the words "NA" then it returns 0 as an answer ... otherwise it
calcs the datedif function.

Hope this helps
JulieD
(the other Julie)

Steve Scott said:
Thanks Julie this worked, however what is the purpose of the first part of
the formula ie IIf([Finish1]=ProjDateValue("NA"),0

JulieS said:
Hi Steve,

Try this formula in one of the spare Number fields:

IIf([Finish1]=ProjDateValue("NA"),0,DateDiff("d",[Finish],[Finish1]))

Hope this helps. Let us know how you get along.
Julie

:

Formula is:-

Date1= DateDiff("dd",[Finish],[Finish1])

:

Hi steve

what is the actual formula you are using as it seems to work fine for
me.

Cheers
JulieD

I am using DateDiff to find the interval between two dates. But it
is
producing an error message in the column. Can anyone explain under
what
circumstances would DateDiff not work??
 

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