ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010
-
23 juin 2008 à 10:31
ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010
-
23 juin 2008 à 13:57
Slt, j'ai un probléme de virgule avec ma syntaxe. ça doit etre un probléme de "." et( de",".
Pouvez-vous m'aider?
Dim taux() As Double
ReDim taux(20)
For k = 1 To 20
taux(k) = 1
Next
Set rss = Db.OpenRecordset("SELECT [Index TP01].TP01, [Index TP01].dateValeur FROM [Index TP01] WHERE ((([Index TP01].dateValeur)=#1/1/" & annéeVal & "#));")
indexval = rss![TP01] If indexval 0 Or IsNull(indexval) Then indexval 1
For i = 1 To annéeFin - annéeDep
Set rss = Db.OpenRecordset("SELECT [Index TP01].TP01, [Index TP01].Provisoire, [Index TP01].dateValeur FROM [Index TP01] WHERE ((([Index TP01].dateValeur)=#1/1/" & annéeDep - 1 + i & "#));")
If IsNull(rss![TP01]) Then
taux(i) = rss![Provisoire] / indexval
Else
taux(i) = rss![TP01] / indexval
End If
Next i
rss.Close
Db.Execute "DELETE BudgetAct.*, BudgetAct.Projet FROM BudgetAct WHERE (((BudgetAct.Projet)=" & glob_sres & "));"
sql = "INSERT INTO BudgetAct ( Projet, Macrotache, [Numero et], N1 ) SELECT Budget.Projet, Budget.Macrotache, Budget.[Numero et], "
sql = sql & "[N1]*(" & taux(1) & ") AS Expr1, "
sql = sql & "FROM Budget WHERE (((Budget.Projet)=" & glob_sres & "));"
Debug.Print sql
Db.Execute sql
Rs.MoveNext
Loop
Rs.Close
ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010 23 juin 2008 à 11:06
Peut etre que je me suis pas bien exprimé. C'est un probléme de conversion. Meme en utilisant cdbl comme suit, j'ai la meme erreur:
If IsNull(rss![TP01]) Then
taux(i) = rss![Provisoire] / indexval
Else
taux(i) = rss![TP01] / indexval
End If
taux(i) = CDbl(taux(i))
PCPT
Messages postés13272Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 201847 23 juin 2008 à 13:49
salut,
umm, tu fais ta conversion trop tard
If IsNull(rss![TP01]) Then
taux(i) = CDbl(rss![Provisoire])
Else
taux(i) = CDbl(rss![TP01])
End If
taux(i) = taux(i) / indexval
<hr size="2" width="100%" />Prenez un instant pour répondre à [infomsg_SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp