Re : Excel & oracle
J'ai encore une question decidement !!
s_moins_1 = Sheets("init").Range("B4").Value
s_plus_1 = Sheets("init").Range("B5").Value
Sheets("donnee").Range("A1").Select
With Selection.QueryTable
.Connection = "OLEDB;Provider=MSDAORA.1;User ID=toto;Data Source=BASEBDD"
.CommandType = xlCmdSql
.CommandText = Array( _
"SELECT ATTR_184 as "" Semaine MEP "" , ATTR_174 as "" Indispo Client "", ATTR_164 as "" Date de mep souhaitée "", ATTR_1 as Titre,ATTR_180 as SSA,ATTR_175 as "" Ligne de production "", ATTR_177 as "" Motif/Urgence "", ATTR_178 as "" Nature" _
, _
" de la mep "",STATUS as "" Statut "", CH_DOC_ID AS "" ID "" FROM CM_ATTRIBUTES A, CM_CATALOGUE C where A.CH_UID=C.CH_UID and (ATTR_175 like '%LS-MID%' or ATTR_175 like '%LS-A%')and (ATTR_184 between ' & " & s_moins_1 & " & ' and ' & " & s_plus_1 & " & ') AND ATTR_164 like '%2008' order by ATTR" _
, "_184")
.Refresh BackgroundQuery:=False
End With
Mon pb est que les variables ne sont pas prisent en compte.
Ma requete est elle mauvaise(enfin elle fonctionne si on remplace & " & s_moins_1 & " & par un chiffre