cs_caio
Messages postés2Date d'inscriptionmercredi 7 juin 2006StatutMembreDernière intervention14 juin 2006
-
7 juin 2006 à 09:37
cs_DARKSIDIOUS
Messages postés15814Date d'inscriptionjeudi 8 août 2002StatutMembreDernière intervention 4 mars 2013
-
7 juin 2006 à 10:28
probleme de requte sur mon ADODC
code source :
Public Function reporting_option()
'On Error Resume Next
If Option1.Value = True Then
sql = "SELECT Sum(CommandeLigne.MontantHT_E) AS SommeDeMontantHT_E, CompteGeneralEtAnalytique.CompteAnalytiqueFR " & _ "FROM ((Commande INNER JOIN CommandeLigne ON Commande.NoCommande CommandeLigne.NoCommande) INNER JOIN Article ON CommandeLigne.CodeArticle Article.CodeArticle) INNER JOIN CompteGeneralEtAnalytique ON Article.NoFamille = CompteGeneralEtAnalytique.Reference " & _
"Where (((Commande.Etat) <= 3) And ((Commande.DateCreation) <= #" & dates & "#) And ((Commande.Type) > 0)) " & _
"GROUP BY CompteGeneralEtAnalytique.CompteAnalytiqueFR;"
tbl = "ReportingBackLog"
End If
If Option2.Value = True Then
sql = "SELECT Sum(CommandeLigne.MontantHT_E) AS SommeDeMontantHT_E, CompteGeneralEtAnalytique.CompteAnalytiqueFR " & _ "FROM ((Commande INNER JOIN CommandeLigne ON Commande.NoCommande CommandeLigne.NoCommande) INNER JOIN Article ON CommandeLigne.CodeArticle Article.CodeArticle) INNER JOIN CompteGeneralEtAnalytique ON Article.NoFamille = CompteGeneralEtAnalytique.Reference " & _
"Where (((Commande.Etat) <= 3) And ((Commande.DateCreation) >= #" & dates & "#) And ((Commande.Type) > 0)) " & _
"GROUP BY CompteGeneralEtAnalytique.CompteAnalytiqueFR;"
tbl = "ReportingOrders"
End If
If Option3.Value = True Then
sql = "SELECT Sum(FactureLigne.MontantHT_E) AS SommeDeMontantHT_E, CompteGeneralEtAnalytique.CompteAnalytiqueFR " & _ "FROM ((Facture INNER JOIN FactureLigne ON Facture.NoFacture FactureLigne.NoFacture) INNER JOIN Article ON FactureLigne.CodeArticle Article.CodeArticle) INNER JOIN CompteGeneralEtAnalytique ON Article.NoFamille = CompteGeneralEtAnalytique.Reference " & _
"Where (((Facture.DateFacture) >= #" & dates & "#) And ((Facture.NoFacture) >= " & Chr(34) & "FM05000000" & Chr(34) & " And (Facture.NoFacture) <= " & Chr(34) & "PM05000000" & Chr(34) & ")) " & _
"GROUP BY CompteGeneralEtAnalytique.CompteAnalytiqueFR;"
tbl = "ReportingSales"
End If
If Option4.Value = True Then
sql = "SELECT Commande.Type, Commande.NoClient, Commande.Nom, Commande.Etat, CommandeLigne.MontantHT_E, Commande.DateCreation, Client.NoSecteurAct " & _ "FROM (Commande INNER JOIN CommandeLigne ON Commande.NoCommande CommandeLigne.NoCommande) INNER JOIN Client ON Commande.NoClient Client.NoClient " & _
"WHERE (((Commande.Type)>0) AND ((Commande.Etat)<3) AND ((Commande.DateCreation)<=#" & dates & "#) AND ((Client.NoSecteurAct)=" & Chr(34) & "002" & Chr(34) & "));"
tbl = "ReportingBackLogGroupe"
End If
If Option5.Value = True Then
sql = "SELECT Commande.Type, Commande.NoClient, Commande.Nom, Commande.Etat, CommandeLigne.MontantHT_E, Commande.DateCreation, Client.NoSecteurAct " & _ "FROM (Commande INNER JOIN CommandeLigne ON Commande.NoCommande CommandeLigne.NoCommande) INNER JOIN Client ON Commande.NoClient Client.NoClient " & _
"WHERE (((Commande.Type)>0) AND ((Commande.Etat)<3) AND ((Commande.DateCreation)>=#" & dates & "#) AND ((Client.NoSecteurAct)=" & Chr(34) & "002" & Chr(34) & "));"
tbl = "ReportingOrdersGroupe"
End If
If Option6.Value = True Then
sql = "SELECT DISTINCTROW Facture.NoClient, Facture.Nom, FactureLigne.CompteAnalytique, FactureLigne.CompteGeneral, Sum(FactureLigne.MontantHT_E) AS SommeDeMontantHT_E, Facture.DateFacture " & _ "FROM (Facture INNER JOIN Client ON Facture.NoClient Client.NoClient) INNER JOIN FactureLigne ON Facture.NoFacture FactureLigne.NoFacture " & _
"Where (((Facture.NoFacture) >= " & Chr(34) & "FM050000" & Chr(34) & " And (Facture.NoFacture) < " & Chr(34) & "PM050000" & Chr(34) & ") And ((Facture.DateFacture) >= #" & dates & "#)) " & _
"GROUP BY Facture.NoClient, Facture.Nom, FactureLigne.CompteAnalytique, FactureLigne.CompteGeneral, Facture.DateFacture, Client.NoSecteurAct " & _
"HAVING (((Client.NoSecteurAct)=" & Chr(34) & "002" & Chr(34) & "));"
tbl = "ReportingSalesGroupe"
End If