Torna al Thread
query = " select Sum(Buoni) AS SommaDiBuoni , Sum(Bloccati) AS SommaDiBloccati, Sum(Scarto) AS SommaDiScarto From Produzione where ((Produzione.Data Between Date()-4 And Date())and (Linea = '" & CasellaCombinata1 & "'))"
Set rs = CurrentDb.OpenRecordset(query)
If rs.RecordCount = 0 Then
Buoni.Value = " "
Bloccati.Value = " "
Scarto.Value = " "
Else
Buoni.Value = rs("SommaDiBuoni")
Bloccati.Value = rs("SommaDiBloccati")
Scarto = rs("SommaDiScarto")
rs.Close
End If