1 2 3 4
| SELECT [Bon de commande].[N°bon de commande], [Bon de commande].[date de bon de commande], [Bon de commande].N°devis, Fournisseur.Nom AS Fournisseur_Nom, Budget.id_budget, Budget.nom AS Budget_nom, Demandeur.nom AS Demandeur_nom, Demandeur.prénom, Direction.nom AS Direction_nom, Service.nom AS Service_nom, [Description commande].quantité, [Description commande].[Remise fournisseur], Désignation.Nom AS Désignation_Nom, Désignation.[Prix unitaire], Désignation.TVA_produit, [Bon de commande].[id_bon de commande], [Prix unitaire]*[Remise fournisseur] AS [Remise par produit], Sum(([Prix unitaire]-[Remise par produit])*[quantité]) AS [Montant HT], [Montant HT]*[TVA_produit] AS [TVA par produit], [Budget prévisionnel].[Montant budget prévisionnel]
FROM (Direction INNER JOIN Service ON Direction.id_direction = Service.direction) INNER JOIN (Fournisseur INNER JOIN (Désignation INNER JOIN (Demandeur INNER JOIN (Budget INNER JOIN ([Budget prévisionnel] INNER JOIN ([Bon de commande] INNER JOIN [Description commande] ON [Bon de commande].[id_bon de commande] = [Description commande].[bon de commande]) ON [Budget prévisionnel].[id_Budget prévisionnel] = [Bon de commande].[budget prévisionnel]) ON Budget.id_budget = [Bon de commande].budget) ON Demandeur.id_demandeur = [Bon de commande].demandeur) ON Désignation.id_désignation = [Description commande].désignation) ON Fournisseur.id_fournisseur = [Bon de commande].fournisseur) ON Service.id_service = Demandeur.service
GROUP BY [Bon de commande].[N°bon de commande], [Bon de commande].[date de bon de commande], [Bon de commande].N°devis, Fournisseur.Nom, Budget.id_budget, Budget.nom, Demandeur.nom, Demandeur.prénom, Direction.nom, Service.nom, [Description commande].quantité, [Description commande].[Remise fournisseur], Désignation.Nom, Désignation.[Prix unitaire], Désignation.TVA_produit, [Bon de commande].[id_bon de commande], [Budget prévisionnel].[Montant budget prévisionnel]
ORDER BY Budget.nom, Direction.nom, Service.nom; |
Partager