DateDiff Null Previous 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
 
M

Michel Walsh

Hi,



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



Hoping it may help,
Vanderghast, Access MVP
 
G

Guest

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
 
D

Douglas J. Steele

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
 

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

Similar Threads

Datediff Help 3
Lapsed Time when 1 date is null 2
Issues with Datediff function 2
DateDiff Calculation 4
Date comparisons 5
DateDiff - Calculate Full months 2
DATEDIFF 3
Datediff in ADP 2

Top