Hallo, Il 04/01/2018 12.39, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] ha scritto: > Are you sure that your query really returns all nulls and this is not a > visual bug in > the tool you run this query in? Show log from isql, please. the log is: SQL> SELECT CON> DEPOSITO_ID, CON> RIPORTO, CON> CARICO, CON> SCARICO, CON> RIPORTO + ESISTENZA AS ESISTENZA, CON> IMPEGNATI, CON> ORDINATI CON> FROM CON> ( CON> SELECT CON> DT.DEPOSITO_ID, CON> (SELECT CON> SUM(DC2.CARICO - DC2.SCARICO) CON> FROM CON> DOC_CORPO DC2, CON> DOC_TESTA DT2 CON> WHERE CON> DC2.DOC_TESTA_ID = DT2.ID CON> AND DC2.ARTICOLO_ID = 'CRSSV750' CON> AND DT2.DATA < '01/01/2018' CON> ) AS RIPORTO, CON> SUM(DC.CARICO) as Carico, CON> SUM(DC.SCARICO) as Scarico, CON> SUM(DC.CARICO - DC.SCARICO) as ESISTENZA, CON> SUM(DC.IMPEGNATI) as Impegnati, CON> SUM(DC.ORDINATI) as Ordinati CON> FROM CON> DOC_CORPO DC, DOC_TESTA DT CON> WHERE CON> DC.DOC_TESTA_ID = DT.ID CON> AND DC.ARTICOLO_ID = 'CRSSV750' CON> AND DT.DATA >= '01/01/2018' CON> AND DT.DATA <= '12/31/2018' CON> GROUP BY CON> DT.DEPOSITO_ID CON> ); SQL> SELECT CON> DEPOSITO_ID, CON> RIPORTO, CON> CARICO, CON> SCARICO, CON> RIPORTO + ESISTENZA AS ESISTENZA, CON> IMPEGNATI, CON> ORDINATI CON> FROM CON> ( CON> SELECT CON> DT.DEPOSITO_ID, CON> (SELECT CON> SUM(DC2.CARICO - DC2.SCARICO) CON> FROM CON> DOC_CORPO DC2, CON> DOC_TESTA DT2 CON> WHERE CON> DC2.DOC_TESTA_ID = DT2.ID CON> AND DC2.ARTICOLO_ID = 'CRSSV750' CON> AND DT2.DATA < '01/01/2017' CON> ) AS RIPORTO, CON> SUM(DC.CARICO) as Carico, CON> SUM(DC.SCARICO) as Scarico, CON> SUM(DC.CARICO - DC.SCARICO) as ESISTENZA, CON> SUM(DC.IMPEGNATI) as Impegnati, CON> SUM(DC.ORDINATI) as Ordinati CON> FROM CON> DOC_CORPO DC, DOC_TESTA DT CON> WHERE CON> DC.DOC_TESTA_ID = DT.ID CON> AND DC.ARTICOLO_ID = 'CRSSV750' CON> AND DT.DATA >= '01/01/2017' CON> AND DT.DATA <= '12/31/2017' CON> GROUP BY CON> DT.DEPOSITO_ID CON> );
DEPOSITO_ID RIPORTO CARICO SCAR ICO ESISTENZA IMPEGNATI ORDINATI =========== ======================= ======================= ==================== === ======================= ======================= ======================= 1 0.0000000000000000 1.000000000000000 0.0000000000000 000 1.000000000000000 0.0000000000000000 0.0000000000000000 As you see: - if I select between 01/01/2018 and 31/12/2018 the are not rows in DT - if I select between 01/01/2017 and 31/12/2017 works fine because the are at least 1 row in DT Any suggestion? Thanks. -- Luigi Siciliano -------------------------- ------------------------------------ ------------------------------------ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Visit http://www.firebirdsql.org and click the Documentation item on the main (top) menu. Try FAQ and other links from the left-side menu there. Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ------------------------------------ Yahoo Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) <*> To change settings via email: firebird-support-dig...@yahoogroups.com firebird-support-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: firebird-support-unsubscr...@yahoogroups.com <*> Your use of Yahoo Groups is subject to: https://info.yahoo.com/legal/us/yahoo/utos/terms/