DateDiff Null Previous Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a series of dates when certain events happen. I am calculating the
Cycle time for some Metrics with DateDiff Calcs.

What I am searching for is the DateDiff Function to omit a date field if it
is null and calculate a previous date if this is the case. In other words,
DateDiff("d",[Date1],[Date2]) ... If Date 2 is empty, then
DateDiff("d",[Date1],[Date3]).

Does anyone know how to write this?

Thank you so Much,
Cathy
 
Hi,



DateDiff("d", Date1, Nz(Date2, Date3) )



Hoping it may help,
Vanderghast, Access MVP
 
Thank you for your response, but it didn't work. Do I need to give you more
information or do you have any other ideas?

Thanks you so much,
Cathy

Michel Walsh said:
Hi,



DateDiff("d", Date1, Nz(Date2, Date3) )



Hoping it may help,
Vanderghast, Access MVP


Cathy said:
Hello,

I have a series of dates when certain events happen. I am calculating the
Cycle time for some Metrics with DateDiff Calcs.

What I am searching for is the DateDiff Function to omit a date field if
it
is null and calculate a previous date if this is the case. In other
words,
DateDiff("d",[Date1],[Date2]) ... If Date 2 is empty, then
DateDiff("d",[Date1],[Date3]).

Does anyone know how to write this?

Thank you so Much,
Cathy
 
Explaining what "it didn't work" means would go a long way...

Do you get an error message? If so, what is it. Do you get the wrong answer?
If so, is there some consistency or pattern to the wrong answer?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Cathy said:
Thank you for your response, but it didn't work. Do I need to give you more
information or do you have any other ideas?

Thanks you so much,
Cathy

Michel Walsh said:
Hi,



DateDiff("d", Date1, Nz(Date2, Date3) )



Hoping it may help,
Vanderghast, Access MVP


Cathy said:
Hello,

I have a series of dates when certain events happen. I am calculating the
Cycle time for some Metrics with DateDiff Calcs.

What I am searching for is the DateDiff Function to omit a date field if
it
is null and calculate a previous date if this is the case. In other
words,
DateDiff("d",[Date1],[Date2]) ... If Date 2 is empty, then
DateDiff("d",[Date1],[Date3]).

Does anyone know how to write this?

Thank you so Much,
Cathy
 
Back
Top