Salve a tutti! Vi chiedo una mano perché non riesco ad uscirne...
Ho due tabelle
SQL_fascia_A_23_24_1 = " SELECT "
SQL_fascia_A_23_24_1 = SQL_fascia_A_23_24_1 & " Count(isNull([02_forn_protesi].id_F_PRO),0) AS TOT_id_PRO, Sum([02_forn_protesi].F_PRO_im_fatt) AS TOT_fattura, [02_forn_protesi].id_PRO "
SQL_fascia_A_23_24_1 = SQL_fascia_A_23_24_1 & " FROM 02_forn_protesi LEFT JOIN 01_ass ON [02_forn_protesi].id_ASS = [01_ass].id_ass "
SQL_fascia_A_23_24_1 = SQL_fascia_A_23_24_1 & " WHERE ([02_forn_protesi].id_PRO = 160 Or [02_forn_protesi].id_PRO = 161 Or [02_forn_protesi].id_PRO = 162 Or [02_forn_protesi].id_PRO = 179 Or [02_forn_protesi].id_PRO =180 Or [02_forn_protesi].id_PRO = 181) AND [02_forn_protesi].[F_PRO_d_pa_fatt] Between '"&var_acus_DAL_1&"' and '"&var_acus_AL_1&"' AND [01_assicurato].id_SEDE = " & var_id_sede & " "
SQL_fascia_A_23_24_1 = SQL_fascia_A_23_24_1 & " GROUP BY [02_forn_protesi].id_PRO "
Set rs_fascia_A_23_24_1 = Connes.Execute(SQL_fascia_A_23_24_1)
if rs_fascia_A_23_24_1("TOT_id_PRO") = 0 then
response.write " TOTALE " & rs_fascia_A_23_24_1("id_PRO") & ": 0 " & "
"
else
response.write " TOTALE " & rs_fascia_A_23_24_1("id_PRO") & " - " & rs_fascia_A_23_24_1("TOT_id_PRO") & "
"
end if
vorrei che stampi
TOTALE 160 0
TOTALE 161 0
TOTALE 162 0
TOTALE 179 - 2
TOTALE 180 - 5
TOTALE 181 0
Ossia vorrei che venga visualizzato anche gli id_PRO non presenti nella tabella
(scusate la mia ignoranza)
Come ne esco?
Grato e grazie a chi ma dà aiuto.



Rispondi quotando