gabrenicolas
Messages postés9Date d'inscriptionlundi 3 août 2009StatutMembreDernière intervention 1 septembre 2009
-
24 août 2009 à 12:09
nhervagault
Messages postés6063Date d'inscriptiondimanche 13 avril 2003StatutMembreDernière intervention15 juillet 2011
-
25 août 2009 à 11:26
Bonjour à tous,
Petit problème avec le code suivant ca ne passe pas JOIN error...
Quelqu'un pourrait-il éclairer ma lanterne...
le code:
Private Sub Form_Load()
Dim SqlStr As String
Dim rs As DAO.Recordset
txtDateRef = Date
'load data
SqlStr = "SELECT type.TYPE, Count(*) AS [counter]" & _
"FROM ((HISTORY.STATUS_ID JOIN STATUS.ID)JOIN TYPE.ID)" & _
"WHERE (((history.STATUS_ID)=[status].[id]) AND ((status.STATUS)='Refused') AND ((history.COUPONTYPE_ID)=[type].[id]) AND ((Format([history].[modifydatetime],'MM/DD/YYYY'))='10/08/2008') AND ((history.MODIFYDATETIME)=(select max(history2.modifydatetime) from history as history2 where history2.couponid = history.couponid)))" & _
"GROUP BY type.TYPE" & _
"HAVING (((type.TYPE)='1 client'));"
Set rs = CurrentDb.OpenRecordset(SqlStr)
rs.MoveFirst
Me.txtopen1Nbr = rs!COUNTER
rs.Close