DateDiff And Null field

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

Guest

I have two fields in my table: Date Received And Date closed. I would like a
Date Diff on my form to show how many days I have had something if the Date
Closed field is Null (ie not closed). I have a field to show how many days
between received and closed but how many days open would be quite useful.
Also could i run a report to show all entries in the table that are not
closed and the number of days since receipt? Thanks from a newbie
 
Arvin, Thanks for the reply. I am getting a error message stating 'expression
has function containing the wrong no. of arguments. I can see that there is a
bracket missing and have tried to apply one in various places but am having
no joy. Any further advice?

Arvin Meyer said:
DateDiff("d", [Date Received], IIf(IsNull([DateClosed],Date(),[DateClosed]))
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Johnny said:
I have two fields in my table: Date Received And Date closed. I would like a
Date Diff on my form to show how many days I have had something if the Date
Closed field is Null (ie not closed). I have a field to show how many days
between received and closed but how many days open would be quite useful.
Also could i run a report to show all entries in the table that are not
closed and the number of days since receipt? Thanks from a newbie
 
Sorry, that's what happens when you type directly into a newsreader. Try:

DateDiff("d", [Date Received],
IIf(IsNull([DateClosed]),Date(),[DateClosed]))

I've add a closing parenthesis after the first DateClosed. (Again in the
newsreader <g>)
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Johnny said:
Arvin, Thanks for the reply. I am getting a error message stating 'expression
has function containing the wrong no. of arguments. I can see that there is a
bracket missing and have tried to apply one in various places but am having
no joy. Any further advice?

Arvin Meyer said:
DateDiff("d", [Date Received], IIf(IsNull([DateClosed],Date(),[DateClosed]))
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Johnny said:
I have two fields in my table: Date Received And Date closed. I would
like
a
Date Diff on my form to show how many days I have had something if the Date
Closed field is Null (ie not closed). I have a field to show how many days
between received and closed but how many days open would be quite useful.
Also could i run a report to show all entries in the table that are not
closed and the number of days since receipt? Thanks from a newbie
 
Back
Top