-
probleme sur date
Bonjour
Lorsque j'attache une table SQL SERVER 2000 dans ACCESS et que je souhaite faire une différence de date, le programme me dit que les arguments de type DATETIME ne peuvent être pris comme arguments. J'ai un SQL SERVER 2000 et ACCESS97.
Voici l'instruction que je veux faire sous ACCESS :
Sum([D_Livraison]-[D_Création])
Voici la requête entière :
SELECT T_Demandes.N_Agences, T_Demandes.N_Demande, T_Demandes.D_Création, T_Livraisons.D_Livraison, T_Lignes_Demandes.REF_Produit, Year([D_Création]) AS AA, Month([D_Création]) AS Mois, Sum(T_Livraisons.QT_Livré) AS Tot_Livré, Sum([D_Livraison]-[D_Création]) AS [Nbr jours] INTO [tp-1]
FROM (T_Demandes INNER JOIN T_Lignes_Demandes ON T_Demandes.N_Demande = T_Lignes_Demandes.Num_Demande) INNER JOIN T_Livraisons ON T_Lignes_Demandes.N_Ligne_Demande = T_Livraisons.Num_Ligne_Demandes
GROUP BY T_Demandes.N_Agences, T_Demandes.N_Demande, T_Demandes.D_Création, T_Livraisons.D_Livraison, T_Lignes_Demandes.REF_Produit, Year([D_Création]), Month([D_Création])
HAVING (((Sum([D_Livraison]-[D_Création]))>=0 And (Sum([D_Livraison]-[D_Création]))<2));
-
Il faut je pense remplacer :
Code:
[D_Livraison]-[D_Création]
par :
Code:
datediff(dd,[D_Livraison], [D_Création])