requete SQL

Le
Macgiver
Bonjour a tous je voudrais transformer cette requete SQL en VBA :

SELECT [T_employes]![groupeemploye] & "-" & [T_employes]![noemploye] AS [No
emp], T_production.employe AS Nom, T_production.date, T_production.nbr_hre
AS AH01, Sum([T_production]![poids]*[T_produits]![taux_sans_camp]) AS AM01,
5 AS FM14, 5 AS FM15, 5 AS FM16, "" AS DM19, "" AS vide1, "" AS vide2, "" AS
vide3, "" AS vide4, "" AS vide5, "01" AS Niv1, "" AS Niv2, 30 AS Niv3, "065"
AS Niv4, 65 AS Projet, "" AS [Note]
FROM var_periode INNER JOIN (T_employes INNER JOIN (T_produits INNER JOIN
(T_production INNER JOIN T_dates ON T_production.date = T_dates.date) ON
T_produits.produit = T_production.type_epice) ON T_employes.employe =
T_production.employe) ON var_periode.periode = T_dates.periode
GROUP BY [T_employes]![groupeemploye] & "-" & [T_employes]![noemploye],
T_production.employe, T_production.date, T_production.nbr_hre, 5, 5, 5, "",
"", "", "01", 30, "065", 65;


est-il possible?

merci
Vidéos High-Tech et Jeu Vidéo
Téléchargements
Vos réponses
Gagnez chaque mois un abonnement Premium avec GNT : Inscrivez-vous !
Trier par : date / pertinence
Thierry
Le #19221221
Bonjour,

Dim strSQL As String
strSQL = "SELECT [T_employes]![groupeemploye] & ""-"" &
[T_employes]![noemploye] AS [No
emp]" & vbCrLf
strSQL = strSQL & " , T_production.employe AS Nom" & vbCrLf
strSQL = strSQL & " , T_production.date" & vbCrLf
strSQL = strSQL & " , T_production.nbr_hre AS AH01" & vbCrLf
strSQL = strSQL & " ,
Sum([T_production]![poids]*[T_produits]![taux_sans_camp]) AS AM01" & vbCrLf
strSQL = strSQL & " , 5 AS FM14" & vbCrLf
strSQL = strSQL & " , 5 AS FM15" & vbCrLf
strSQL = strSQL & " , 5 AS FM16" & vbCrLf
strSQL = strSQL & " , """" AS DM19" & vbCrLf
strSQL = strSQL & " , """" AS vide1" & vbCrLf
strSQL = strSQL & " , """" AS vide2" & vbCrLf
strSQL = strSQL & " , """" AS vide3" & vbCrLf
strSQL = strSQL & " , """" AS vide4" & vbCrLf
strSQL = strSQL & " , """" AS vide5" & vbCrLf
strSQL = strSQL & " , ""01"" AS Niv1" & vbCrLf
strSQL = strSQL & " , """" AS Niv2" & vbCrLf
strSQL = strSQL & " , 30 AS Niv3" & vbCrLf
strSQL = strSQL & " , ""065"" AS Niv4" & vbCrLf
strSQL = strSQL & " , 65 AS Projet" & vbCrLf
strSQL = strSQL & " , """" AS [Note]" & vbCrLf
strSQL = strSQL & " FROM var_periode " & vbCrLf
strSQL = strSQL & " INNER JOIN (T_employes " & vbCrLf
strSQL = strSQL & " INNER JOIN (T_produits " & vbCrLf
strSQL = strSQL & " INNER JOIN (T_producti" & vbCrLf
strSQL = strSQL & " ON " & vbCrLf
strSQL = strSQL & " INNER JOIN T_dates " & vbCrLf
strSQL = strSQL & " ON T_production.date = T_dates.date) " &
vbCrLf
strSQL = strSQL & " ON T_produits.produit =
T_production.type_epice) " & vbCrLf
strSQL = strSQL & " ON T_employes.employe = T_production.employe)
" & vbCrLf
strSQL = strSQL & " ON var_periode.periode = T_dates.periode" &
vbCrLf
strSQL = strSQL & " GROUP BY [T_employes]![groupeemploye] & ""-"" &
[T_employes]![noemploye]" & vbCrLf
strSQL = strSQL & " , T_production.employe" & vbCrLf
strSQL = strSQL & " , T_production.date" & vbCrLf
strSQL = strSQL & " , T_production.nbr_hre" & vbCrLf
strSQL = strSQL & " , 5" & vbCrLf
strSQL = strSQL & " , 5" & vbCrLf
strSQL = strSQL & " , 5" & vbCrLf
strSQL = strSQL & " , """"" & vbCrLf
strSQL = strSQL & " , """"" & vbCrLf
strSQL = strSQL & " , """"" & vbCrLf
strSQL = strSQL & " , ""01""" & vbCrLf
strSQL = strSQL & " , 30" & vbCrLf
strSQL = strSQL & " , ""065""" & vbCrLf
strSQL = strSQL & " , 65;"

bon courage

"Macgiver" news:
Bonjour a tous je voudrais transformer cette requete SQL en VBA :

SELECT [T_employes]![groupeemploye] & "-" & [T_employes]![noemploye] AS
[No emp], T_production.employe AS Nom, T_production.date,
T_production.nbr_hre AS AH01,
Sum([T_production]![poids]*[T_produits]![taux_sans_camp]) AS AM01, 5 AS
FM14, 5 AS FM15, 5 AS FM16, "" AS DM19, "" AS vide1, "" AS vide2, "" AS
vide3, "" AS vide4, "" AS vide5, "01" AS Niv1, "" AS Niv2, 30 AS Niv3,
"065" AS Niv4, 65 AS Projet, "" AS [Note]
FROM var_periode INNER JOIN (T_employes INNER JOIN (T_produits INNER JOIN
(T_production INNER JOIN T_dates ON T_production.date = T_dates.date) ON
T_produits.produit = T_production.type_epice) ON T_employes.employe =
T_production.employe) ON var_periode.periode = T_dates.periode
GROUP BY [T_employes]![groupeemploye] & "-" & [T_employes]![noemploye],
T_production.employe, T_production.date, T_production.nbr_hre, 5, 5, 5,
"", "", "", "01", 30, "065", 65;


est-il possible?

merci



Thierry
Le #19221751
Je le remets car le copier/coller n'a pas fonctionné parfaitement :

Dim strSQL As String
strSQL = "SELECT [T_employes]![groupeemploye] & ""-"" &
[T_employes]![noemploye] AS [Noemp]" & vbCrLf
strSQL = strSQL & " , T_production.employe AS Nom" & vbCrLf
strSQL = strSQL & " , T_production.date" & vbCrLf
strSQL = strSQL & " , T_production.nbr_hre AS AH01" & vbCrLf
strSQL = strSQL & " ,
Sum([T_production]![poids]*[T_produits]![taux_sans_camp]) AS AM01" & vbCrLf
strSQL = strSQL & " , 5 AS FM14" & vbCrLf
strSQL = strSQL & " , 5 AS FM15" & vbCrLf
strSQL = strSQL & " , 5 AS FM16" & vbCrLf
strSQL = strSQL & " , """" AS DM19" & vbCrLf
strSQL = strSQL & " , """" AS vide1" & vbCrLf
strSQL = strSQL & " , """" AS vide2" & vbCrLf
strSQL = strSQL & " , """" AS vide3" & vbCrLf
strSQL = strSQL & " , """" AS vide4" & vbCrLf
strSQL = strSQL & " , """" AS vide5" & vbCrLf
strSQL = strSQL & " , ""01"" AS Niv1" & vbCrLf
strSQL = strSQL & " , """" AS Niv2" & vbCrLf
strSQL = strSQL & " , 30 AS Niv3" & vbCrLf
strSQL = strSQL & " , ""065"" AS Niv4" & vbCrLf
strSQL = strSQL & " , 65 AS Projet" & vbCrLf
strSQL = strSQL & " , """" AS [Note]" & vbCrLf
strSQL = strSQL & " FROM var_periode " & vbCrLf
strSQL = strSQL & " INNER JOIN (T_employes " & vbCrLf
strSQL = strSQL & " INNER JOIN (T_produits " & vbCrLf
strSQL = strSQL & " INNER JOIN (T_producti" & vbCrLf
strSQL = strSQL & " ON " & vbCrLf
strSQL = strSQL & " INNER JOIN T_dates " & vbCrLf
strSQL = strSQL & " ON T_production.date = T_dates.date) " &
vbCrLf
strSQL = strSQL & " ON T_produits.produit =
T_production.type_epice) " & vbCrLf
strSQL = strSQL & " ON T_employes.employe =
T_production.employe) " & vbCrLf
strSQL = strSQL & " ON var_periode.periode = T_dates.periode" &
vbCrLf
strSQL = strSQL & " GROUP BY [T_employes]![groupeemploye] & ""-"" &
[T_employes]![noemploye]" & vbCrLf
strSQL = strSQL & " , T_production.employe" & vbCrLf
strSQL = strSQL & " , T_production.date" & vbCrLf
strSQL = strSQL & " , T_production.nbr_hre" & vbCrLf
strSQL = strSQL & " , 5" & vbCrLf
strSQL = strSQL & " , 5" & vbCrLf
strSQL = strSQL & " , 5" & vbCrLf
strSQL = strSQL & " , """"" & vbCrLf
strSQL = strSQL & " , """"" & vbCrLf
strSQL = strSQL & " , """"" & vbCrLf
strSQL = strSQL & " , ""01""" & vbCrLf
strSQL = strSQL & " , 30" & vbCrLf
strSQL = strSQL & " , ""065""" & vbCrLf
strSQL = strSQL & " , 65;"
A+

"Macgiver" news:
Bonjour a tous je voudrais transformer cette requete SQL en VBA :

SELECT [T_employes]![groupeemploye] & "-" & [T_employes]![noemploye] AS
[No emp], T_production.employe AS Nom, T_production.date,
T_production.nbr_hre AS AH01,
Sum([T_production]![poids]*[T_produits]![taux_sans_camp]) AS AM01, 5 AS
FM14, 5 AS FM15, 5 AS FM16, "" AS DM19, "" AS vide1, "" AS vide2, "" AS
vide3, "" AS vide4, "" AS vide5, "01" AS Niv1, "" AS Niv2, 30 AS Niv3,
"065" AS Niv4, 65 AS Projet, "" AS [Note]
FROM var_periode INNER JOIN (T_employes INNER JOIN (T_produits INNER JOIN
(T_production INNER JOIN T_dates ON T_production.date = T_dates.date) ON
T_produits.produit = T_production.type_epice) ON T_employes.employe =
T_production.employe) ON var_periode.periode = T_dates.periode
GROUP BY [T_employes]![groupeemploye] & "-" & [T_employes]![noemploye],
T_production.employe, T_production.date, T_production.nbr_hre, 5, 5, 5,
"", "", "", "01", 30, "065", 65;


est-il possible?

merci



Publicité
Poster une réponse
Anonyme