Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateDiff if one date is blank

Status
Not open for further replies.

Zonie32

Technical User
Jan 13, 2004
242
US
I have this calculation in a query:

DaysToAnswer: DateDiff("d",[RC_Rec_Date],[Res_Date])

I use this query for a report which I have a calculation to find the average DaysToAnswer =Avg([DaysToAnswer]) which works fine, but what if a date field has no date?

Would that not skew the Average results? How do I fix that if the Res_Date is blank.

It will always be the Res_date that will be the blank one but the RC_Rec_Date will always be filled in. Any help is appreciated!
 
If RC_Rec_Date and Res_Date are true DateTime fields then they can't hold blank value but Null, and Null is correctly handled by both DateDiff and Avg.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top