Bonjour,
J'ai fait une requete qui agit sur les dates, elle fonctionne bien sur Access mais par contre sur Sql server elle marche pas : incorrect syntax near '>'.
ou est ce qu'il est le problème ??
merci
SELECT Left(DateEnr,10) AS DateE, QteReel.M, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 4:0:0# And Right(HeureEnr,8)<#12/30/1899 5:0:0#,1,0)) AS 45, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 5:0:0# And Right(HeureEnr,8)<#12/30/1899 6:0:0#,1,0)) AS 56, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 6:0:0# And Right(HeureEnr,8)<#12/30/1899 7:0:0#,1,0)) AS 67, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 7:0:0# And Right(HeureEnr,8)<#12/30/1899 8:0:0#,1,0)) AS 78, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 8:0:0# And Right(HeureEnr,8)<#12/30/1899 9:0:0#,1,0)) AS 89, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 9:0:0# And Right(HeureEnr,8)<#12/30/1899 10:0:0#,1,0)) AS 910, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 10:0:0# And Right(HeureEnr,8)<#12/30/1899 11:0:0#,1,0)) AS 1011, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 11:0:0# And Right(HeureEnr,8)<#12/30/1899 12:0:0#,1,0)) AS 1112, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 12:0:0# And Right(HeureEnr,8)<#12/30/1899 13:0:0#,1,0)) AS 1213, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 13:0:0# And Right(HeureEnr,8)<#12/30/1899 14:0:0#,1,0)) AS 1314, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 14:0:0# And Right(HeureEnr,8)<#12/30/1899 15:0:0#,1,0)) AS 1415, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 15:0:0# And Right(HeureEnr,8)<#12/30/1899 16:0:0#,1,0)) AS 1516, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 16:0:0# And Right(HeureEnr,8)<#12/30/1899 17:0:0#,1,0)) AS 1617, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 17:0:0# And Right(HeureEnr,8)<#12/30/1899 18:0:0#,1,0)) AS 1718, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 18:0:0# And Right(HeureEnr,8)<#12/30/1899 19:0:0#,1,0)) AS 1819, Sum(IIf(Right(HeureEnr,8)>#12/30/1899 19:0:0# And Right(HeureEnr,8)<#12/30/1899 20:0:0#,1,0)) AS 1920
FROM QteReel
GROUP BY Left(DateEnr,10), QteReel.M
HAVING QteReel.M="609";
Partager