User Tools

Site Tools


find_ar_without_tax

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

find_ar_without_tax [2018/05/28 12:09] (current)
sweitmann created
Line 1: Line 1:
 +Two statements needed using a temporary table:
  
 +First:
 +     ​CREATE TABLE tmp1 AS SELECT id, (SELECT COUNT(*) FROM acc_trans WHERE chart_id IN (SELECT id FROM chart WHERE link LIKE '​%tax%'​ AND acc_trans.trans_id = ar.id)) cnt FROM ar;
 +     
 +Second:
 +     ​SELECT invnumber, amount, netamount FROM ar WHERE id IN (SELECT id FROM tmp1 WHERE cnt=0) AND transdate BETWEEN '​2018-01-01'​ AND '​2018-05-30';​
 +     
 +Once you are done you can run:
 +     DROP TABLE tmp1;
find_ar_without_tax.txt ยท Last modified: 2018/05/28 12:09 by sweitmann