Ciao a tutti, dopo vari tentativi adesso ho questo codice :
che ancora però non è quello che desidero, in quanto mi da solo un mese anche se io inserisco un intervallo maggiore e l'importo non è la somma ma un solo dato !!!codice:SELECT Dipendenti.[Cognome e Nome],Trattamenti.Importo, "&Sum&"(Trattamenti.Importo) AS TOTALE, [Trattamenti].[Data], Month(Trattamenti.Data) AS Mese, Year(Trattamenti.Data) AS Anno FROM Dipendenti RIGHT JOIN Trattamenti ON Dipendenti.[IDImpiegato] = Trattamenti.[IDImpiegato] WHERE Trattamenti.Data>=#"&datainizio&"# AND Trattamenti.Data<=#"&datafine&"# ORDER BY Dipendenti.[Cognome e Nome] ;") %> <% if periodo<>objRs("Mese") then %> <table border="1" cellpadding="6" cellspacing="6"> <tr> <td colspan="5" class="ms-grid8-left" style="background-color: #CCFFFF"><b>Mese di : <%=MonthName(Month(objrs("Data")),False)%> - Anno : <%=(Year(objrs("Data")))%></b> </td> </tr> <tr> <td align="left"><b>Operatore</b></td> <td align="left"><b>Importo</b></td> </tr> <% while NOT objRs.EOF %> <% if precedente<>objRs("Cognome e Nome") then %> <tr> <td align="left"><%=objRs("Cognome e Nome")%></td> <td align="left"><%=" € "&(formatNumber(objRs("TOTALE"),2))%></td> </td> </tr> <% precedente=objRs("Cognome e Nome") end if %> <% periodo=objrs("Mese") %> <% objRs.Movenext wend %> <% objRs.Close Set objRs = Nothing objConn.Close end if Set objConn = Nothing %> </table>
Come posso fare ?

Rispondi quotando