0
votes

I have the following query which works fine except if there is not a value in D that matches F2. I get #N/A but not sure how to correct it so it shows "0".

ABS(QUERY(Transactions,"SELECT SUM(E) WHERE D = '"&$F2&"' AND B > date '"&TEXT($C$1,"yyyy-mm-dd")&"' AND B <= date '"&TEXT($C$2,"yyyy-mm-dd")&"' GROUP BY D LABEL SUM(E) '' ",0))

1

1 Answers

0
votes

you can try:

=IFERROR(ABS(QUERY(Transactions,
 "SELECT SUM(E) 
  WHERE D = '"&$F2&"' 
    AND B >  date '"&TEXT($C$1,"yyyy-mm-dd")&"' 
    AND B <= date '"&TEXT($C$2,"yyyy-mm-dd")&"' 
  GROUP BY D 
  LABEL SUM(E) '' ", 0)), 0)