Hi There,
I have been learning more about SQL from a colleague at work and starting to get the hang of it and seeing the benefits from using the normal query designer.
I have an issue where the following code works, but it returns the #num! error when the result is zero;
Round(Sum(IIf([Last Updated]>=[Period]![Start] And [Last Updated]<=[Period]![End] And [Incident Closed]=Yes And DateDiff("d",[Received Date],[Last Updated])<31,1,0))/Sum(IIf([Last Updated]>=[Period]![Start] And [Last Updated]<=[Period]![End],1,0))*100) AS [% Closed within 30 Days]
I have been reading about using Nz, and using another IIf statement, but each thread I've read I'm still returning #num!
Anyone got any ideas how I can get it to either return nothing or a zero?
Kind Regards
Stuart
P.S. Apologies for the long and probably unnecessary coding, I am trying to modify my predecessors database!
I have been learning more about SQL from a colleague at work and starting to get the hang of it and seeing the benefits from using the normal query designer.
I have an issue where the following code works, but it returns the #num! error when the result is zero;
Round(Sum(IIf([Last Updated]>=[Period]![Start] And [Last Updated]<=[Period]![End] And [Incident Closed]=Yes And DateDiff("d",[Received Date],[Last Updated])<31,1,0))/Sum(IIf([Last Updated]>=[Period]![Start] And [Last Updated]<=[Period]![End],1,0))*100) AS [% Closed within 30 Days]
I have been reading about using Nz, and using another IIf statement, but each thread I've read I'm still returning #num!
Anyone got any ideas how I can get it to either return nothing or a zero?
Kind Regards
Stuart
P.S. Apologies for the long and probably unnecessary coding, I am trying to modify my predecessors database!