Hi, all.
I am trying to write a formula for query builder and it's close but not quite right... I have a table with effectively calls answered and another with calls abandoned within them. I have taken what I need from those tables and discarded what I don't need to give me dates, interval periods etc for answered and another for abandoned. all pretty straightforward so far...
Now what I am looking to do is to merge those two tables and everything works fine except for the Abandoned numbers within the query based on the original two queries being slightly out.
The fields in the original queries are named SumOfInteractions Answered by Agent for Calls Answered and Total Abandoned Calls for Abandoned. There is another field called Interaction Type that will either have the value Inbound or Outbound.
I basically want the formula I am trying to write say that if the Calls Answered and Abandoned are both zero don't enter anything, if the Calls Answered is zero and Abandoned > zero then put the Abandoned, if Calls Answered is greater than zero and Abandoned is zero, set abandoned to zero (or blank), if Calls Answered and Abandoned are both greater than zero then put abandoned. All of these need to be under the condition that if Interaction Type is Outbound then Abandoned Calls is zero (or blank) and to only enter the value for Abandoned if Interaction Type has the value Inbound.
I really hope that makes sense. the Calls Answered field has its own field in the new query and the numbers coming out of that are fine so I am not currently concerned with that. The code I have come up with is the below but like I say it isn't quite there...
Abandoned Calls: Sum(IIf([SumOfInteractions Answered by Agent] Is Null And [Total Abandoned Calls] Is Null,0,IIf([Interaction Type]="Outbound",0,[Total Abandoned Calls])))
Am I woefully off? I am really quite new to Access so if you could give me the kind of answer even an idiot would understand then I would be very grateful.
thanks in advance.
Andy