bonjour à toutes et à tous
j'ai une table TB contenant divers champs et plusieurs lignes. je fais une
boucle while not TB.EOF dans laquelle j'initialise à zéro toutes mais
le dernier enregistrement n'est pas pris en compte, et donc mes valeurs
sont faussées.
comment je peux faire pour que mes valeurs soient prises en compte
autrement que de repasser une dernière fois dans la boucle while not?
merci d'éclairer ma lanterne.
@+
bonjour à toutes et à tous
j'ai une table TB contenant divers champs et plusieurs lignes. je fais une
boucle while not TB.EOF dans laquelle j'initialise à zéro toutes mais
le dernier enregistrement n'est pas pris en compte, et donc mes valeurs
sont faussées.
comment je peux faire pour que mes valeurs soient prises en compte
autrement que de repasser une dernière fois dans la boucle while not?
merci d'éclairer ma lanterne.
@+
bonjour à toutes et à tous
j'ai une table TB contenant divers champs et plusieurs lignes. je fais une
boucle while not TB.EOF dans laquelle j'initialise à zéro toutes mais
le dernier enregistrement n'est pas pris en compte, et donc mes valeurs
sont faussées.
comment je peux faire pour que mes valeurs soient prises en compte
autrement que de repasser une dernière fois dans la boucle while not?
merci d'éclairer ma lanterne.
@+
j'ai une table TB contenant divers champs et plusieurs lignes. je fais
une boucle while not TB.EOF dans laquelle j'initialise à zéro toutes
mais valeurs (donc je fais un tour à vide),
valeurs précédentes avec celles que j'ai trouvé précédemment,
jusqu'Ã la fin de ma table.
suivant : le dernier enregistrement n'est pas pris en compte, et donc
mes valeurs sont faussées. comment je peux faire pour que mes valeurs
soient prises en compte autrement que de repasser une dernière fois
dans la boucle while not? merci d'éclairer ma lanterne.
j'ai une table TB contenant divers champs et plusieurs lignes. je fais
une boucle while not TB.EOF dans laquelle j'initialise à zéro toutes
mais valeurs (donc je fais un tour à vide),
valeurs précédentes avec celles que j'ai trouvé précédemment,
jusqu'Ã la fin de ma table.
suivant : le dernier enregistrement n'est pas pris en compte, et donc
mes valeurs sont faussées. comment je peux faire pour que mes valeurs
soient prises en compte autrement que de repasser une dernière fois
dans la boucle while not? merci d'éclairer ma lanterne.
j'ai une table TB contenant divers champs et plusieurs lignes. je fais
une boucle while not TB.EOF dans laquelle j'initialise à zéro toutes
mais valeurs (donc je fais un tour à vide),
valeurs précédentes avec celles que j'ai trouvé précédemment,
jusqu'Ã la fin de ma table.
suivant : le dernier enregistrement n'est pas pris en compte, et donc
mes valeurs sont faussées. comment je peux faire pour que mes valeurs
soient prises en compte autrement que de repasser une dernière fois
dans la boucle while not? merci d'éclairer ma lanterne.
la boucle est la suivante (elle est longue!!) :
For MonMois=1 to 12
'RAZ des variables
While Not tb.EOF
If tb!MOIS = MonMois Then
If tb!NoOT <> num_OT Then
num_OT = tb!NoOT
tb.Edit
tb!nbint = 1
tb.Update
LeDer:
If MonAction = "Maintenance" Then
If MonDomaine = "Commutation" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THCO = THCO + TotalHeure
TMCO = TMCO + TotalMinute
nbintCO_ad = nbintCO_ad + Nbintervention
Else
nbintCO_sd = nbintCO_sd + 1
End If
End If
If MonDomaine = "Environnement Technique" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THET = THET + TotalHeure
TMET = TMET + TotalMinute
nbintET_ad = nbintET_ad + Nbintervention
Else
nbintET_ad = PRnbintET_ad + 1
End If
End If
If MonDomaine = "Transmission" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THTR = THTR + TotalHeure
TMTR = TMTR + TotalMinute
nbintTR_ad = nbintTR_ad + Nbintervention
Else
nbintTR_sd = nbintTR_sd + 1
End If
End If
If MonDomaine = "DSLAM" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THAD = THAD + TotalHeure
TMAD = TMAD + TotalMinute
nbintDS_ad = nbintDS_ad + Nbintervention
Else
nbintDS_sd = nbintDS_sd + 1
End If
End If
If MonDomaine = "Mobiles" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THMO = THMO + TotalHeure
TMMO = TMMO + TotalMinute
nbintMO_ad = nbintMO_ad + Nbintervention
Else
nbintMO_sd = nbintMO_sd + 1
End If
End If
If MonDomaine = "Autre" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THDI = THDI + TotalHeure
TMDI = TMDI + TotalMinute
nbintDI_ad = nbintDI_ad + Nbintervention
Else
nbintDI_sd = nbintDI_sd + 1
End If
End If
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
Else
If MonDomaine = "Commutation" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHCO = PRTHCO + TotalHeure
PRTMCO = PRTMCO + TotalMinute
PRnbintCO_ad = PRnbintCO_ad + Nbintervention
Else
PRnbintCO_sd = PRnbintCO_sd + 1
End If
End If
If MonDomaine = "Environnement Technique" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHET = PRTHET + TotalHeure
PRTMET = PRTMET + TotalMinute
PRnbintET_ad = PRnbintET_ad + Nbintervention
Else
PRnbintET_sd = PRnbintET_sd + 1
End If
End If
If MonDomaine = "Transmission" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHTR = PRTHTR + TotalHeure
PRTMTR = PRTMTR + TotalMinute
PRnbintTR_ad = PRnbintTR_ad + Nbintervention
Else
PRnbintTR_sd = PRnbintTR_sd + 1
End If
End If
If MonDomaine = "DSLAM" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHAD = PRTHAD + TotalHeure
PRTMAD = PRTMAD + TotalMinute
PRnbintDS_ad = PRnbintDS_ad + Nbintervention
Else
PRnbintDS_sd = PRnbintDS_sd + 1
End If
End If
If MonDomaine = "Mobiles" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHMO = PRTHMO + TotalHeure
PRTMMO = PRTMMO + TotalMinute
PRnbintMO_ad = PRnbintMO_ad + Nbintervention
Else
PRnbintMO_sd = PRnbintMO_sd + 1
End If
End If
If MonDomaine = "Autre" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHDI = PRTHDI + TotalHeure
PRTMDI = PRTMDI + TotalMinute
PRnbintDI_ad = PRnbintDI_ad + Nbintervention
Else
PRnbintDI_sd = PRnbintDI_sd + 1
End If
End If
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
End If
End If
MonAction = tb!Action
MonDomaine = tb!domaine
hh = Left(tb![duree], 2)
mm = Right(tb![duree], 2)
If hh > 7 Then
Nbintervention = Nbintervention + tb!nbint + Fix(hh / 7)
Else
Nbintervention = Nbintervention + tb!nbint
End If
TotalHeure = TotalHeure + hh
TotalMinute = TotalMinute + mm
End If
tb.MoveNext
If last("tb.NoOT") Then
GoTo LeDer
End If
Wend
'code
next MonMois
la boucle est la suivante (elle est longue!!) :
For MonMois=1 to 12
'RAZ des variables
While Not tb.EOF
If tb!MOIS = MonMois Then
If tb!NoOT <> num_OT Then
num_OT = tb!NoOT
tb.Edit
tb!nbint = 1
tb.Update
LeDer:
If MonAction = "Maintenance" Then
If MonDomaine = "Commutation" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THCO = THCO + TotalHeure
TMCO = TMCO + TotalMinute
nbintCO_ad = nbintCO_ad + Nbintervention
Else
nbintCO_sd = nbintCO_sd + 1
End If
End If
If MonDomaine = "Environnement Technique" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THET = THET + TotalHeure
TMET = TMET + TotalMinute
nbintET_ad = nbintET_ad + Nbintervention
Else
nbintET_ad = PRnbintET_ad + 1
End If
End If
If MonDomaine = "Transmission" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THTR = THTR + TotalHeure
TMTR = TMTR + TotalMinute
nbintTR_ad = nbintTR_ad + Nbintervention
Else
nbintTR_sd = nbintTR_sd + 1
End If
End If
If MonDomaine = "DSLAM" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THAD = THAD + TotalHeure
TMAD = TMAD + TotalMinute
nbintDS_ad = nbintDS_ad + Nbintervention
Else
nbintDS_sd = nbintDS_sd + 1
End If
End If
If MonDomaine = "Mobiles" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THMO = THMO + TotalHeure
TMMO = TMMO + TotalMinute
nbintMO_ad = nbintMO_ad + Nbintervention
Else
nbintMO_sd = nbintMO_sd + 1
End If
End If
If MonDomaine = "Autre" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THDI = THDI + TotalHeure
TMDI = TMDI + TotalMinute
nbintDI_ad = nbintDI_ad + Nbintervention
Else
nbintDI_sd = nbintDI_sd + 1
End If
End If
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
Else
If MonDomaine = "Commutation" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHCO = PRTHCO + TotalHeure
PRTMCO = PRTMCO + TotalMinute
PRnbintCO_ad = PRnbintCO_ad + Nbintervention
Else
PRnbintCO_sd = PRnbintCO_sd + 1
End If
End If
If MonDomaine = "Environnement Technique" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHET = PRTHET + TotalHeure
PRTMET = PRTMET + TotalMinute
PRnbintET_ad = PRnbintET_ad + Nbintervention
Else
PRnbintET_sd = PRnbintET_sd + 1
End If
End If
If MonDomaine = "Transmission" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHTR = PRTHTR + TotalHeure
PRTMTR = PRTMTR + TotalMinute
PRnbintTR_ad = PRnbintTR_ad + Nbintervention
Else
PRnbintTR_sd = PRnbintTR_sd + 1
End If
End If
If MonDomaine = "DSLAM" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHAD = PRTHAD + TotalHeure
PRTMAD = PRTMAD + TotalMinute
PRnbintDS_ad = PRnbintDS_ad + Nbintervention
Else
PRnbintDS_sd = PRnbintDS_sd + 1
End If
End If
If MonDomaine = "Mobiles" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHMO = PRTHMO + TotalHeure
PRTMMO = PRTMMO + TotalMinute
PRnbintMO_ad = PRnbintMO_ad + Nbintervention
Else
PRnbintMO_sd = PRnbintMO_sd + 1
End If
End If
If MonDomaine = "Autre" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHDI = PRTHDI + TotalHeure
PRTMDI = PRTMDI + TotalMinute
PRnbintDI_ad = PRnbintDI_ad + Nbintervention
Else
PRnbintDI_sd = PRnbintDI_sd + 1
End If
End If
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
End If
End If
MonAction = tb!Action
MonDomaine = tb!domaine
hh = Left(tb![duree], 2)
mm = Right(tb![duree], 2)
If hh > 7 Then
Nbintervention = Nbintervention + tb!nbint + Fix(hh / 7)
Else
Nbintervention = Nbintervention + tb!nbint
End If
TotalHeure = TotalHeure + hh
TotalMinute = TotalMinute + mm
End If
tb.MoveNext
If last("tb.NoOT") Then
GoTo LeDer
End If
Wend
'code
next MonMois
la boucle est la suivante (elle est longue!!) :
For MonMois=1 to 12
'RAZ des variables
While Not tb.EOF
If tb!MOIS = MonMois Then
If tb!NoOT <> num_OT Then
num_OT = tb!NoOT
tb.Edit
tb!nbint = 1
tb.Update
LeDer:
If MonAction = "Maintenance" Then
If MonDomaine = "Commutation" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THCO = THCO + TotalHeure
TMCO = TMCO + TotalMinute
nbintCO_ad = nbintCO_ad + Nbintervention
Else
nbintCO_sd = nbintCO_sd + 1
End If
End If
If MonDomaine = "Environnement Technique" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THET = THET + TotalHeure
TMET = TMET + TotalMinute
nbintET_ad = nbintET_ad + Nbintervention
Else
nbintET_ad = PRnbintET_ad + 1
End If
End If
If MonDomaine = "Transmission" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THTR = THTR + TotalHeure
TMTR = TMTR + TotalMinute
nbintTR_ad = nbintTR_ad + Nbintervention
Else
nbintTR_sd = nbintTR_sd + 1
End If
End If
If MonDomaine = "DSLAM" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THAD = THAD + TotalHeure
TMAD = TMAD + TotalMinute
nbintDS_ad = nbintDS_ad + Nbintervention
Else
nbintDS_sd = nbintDS_sd + 1
End If
End If
If MonDomaine = "Mobiles" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THMO = THMO + TotalHeure
TMMO = TMMO + TotalMinute
nbintMO_ad = nbintMO_ad + Nbintervention
Else
nbintMO_sd = nbintMO_sd + 1
End If
End If
If MonDomaine = "Autre" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
THDI = THDI + TotalHeure
TMDI = TMDI + TotalMinute
nbintDI_ad = nbintDI_ad + Nbintervention
Else
nbintDI_sd = nbintDI_sd + 1
End If
End If
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
Else
If MonDomaine = "Commutation" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHCO = PRTHCO + TotalHeure
PRTMCO = PRTMCO + TotalMinute
PRnbintCO_ad = PRnbintCO_ad + Nbintervention
Else
PRnbintCO_sd = PRnbintCO_sd + 1
End If
End If
If MonDomaine = "Environnement Technique" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHET = PRTHET + TotalHeure
PRTMET = PRTMET + TotalMinute
PRnbintET_ad = PRnbintET_ad + Nbintervention
Else
PRnbintET_sd = PRnbintET_sd + 1
End If
End If
If MonDomaine = "Transmission" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHTR = PRTHTR + TotalHeure
PRTMTR = PRTMTR + TotalMinute
PRnbintTR_ad = PRnbintTR_ad + Nbintervention
Else
PRnbintTR_sd = PRnbintTR_sd + 1
End If
End If
If MonDomaine = "DSLAM" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHAD = PRTHAD + TotalHeure
PRTMAD = PRTMAD + TotalMinute
PRnbintDS_ad = PRnbintDS_ad + Nbintervention
Else
PRnbintDS_sd = PRnbintDS_sd + 1
End If
End If
If MonDomaine = "Mobiles" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHMO = PRTHMO + TotalHeure
PRTMMO = PRTMMO + TotalMinute
PRnbintMO_ad = PRnbintMO_ad + Nbintervention
Else
PRnbintMO_sd = PRnbintMO_sd + 1
End If
End If
If MonDomaine = "Autre" Then
If TotalHeure <> 0 Or TotalMinute <> 0 Then
PRTHDI = PRTHDI + TotalHeure
PRTMDI = PRTMDI + TotalMinute
PRnbintDI_ad = PRnbintDI_ad + Nbintervention
Else
PRnbintDI_sd = PRnbintDI_sd + 1
End If
End If
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
End If
End If
MonAction = tb!Action
MonDomaine = tb!domaine
hh = Left(tb![duree], 2)
mm = Right(tb![duree], 2)
If hh > 7 Then
Nbintervention = Nbintervention + tb!nbint + Fix(hh / 7)
Else
Nbintervention = Nbintervention + tb!nbint
End If
TotalHeure = TotalHeure + hh
TotalMinute = TotalMinute + mm
End If
tb.MoveNext
If last("tb.NoOT") Then
GoTo LeDer
End If
Wend
'code
next MonMois
If tb!MOIS = MonMois Then
If tb!NoOT <> num_OT Then
num_OT = tb!NoOT
tb.Edit
tb!nbint = 1
tb.Update
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
MonAction = tb!Action
MonDomaine = tb!domaine
hh = Left(tb![duree], 2)
mm = Right(tb![duree], 2)
If hh > 7 Then
Nbintervention = Nbintervention + tb!nbint + Fix(hh / 7)
Else
Nbintervention = Nbintervention + tb!nbint
End If
TotalHeure = TotalHeure + hh ' à corriger si tu es passée dans le
test hh>7 peut-etre
TotalMinute = TotalMinute + mm
If tb!MOIS = MonMois Then
If tb!NoOT <> num_OT Then
num_OT = tb!NoOT
tb.Edit
tb!nbint = 1
tb.Update
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
MonAction = tb!Action
MonDomaine = tb!domaine
hh = Left(tb![duree], 2)
mm = Right(tb![duree], 2)
If hh > 7 Then
Nbintervention = Nbintervention + tb!nbint + Fix(hh / 7)
Else
Nbintervention = Nbintervention + tb!nbint
End If
TotalHeure = TotalHeure + hh ' à corriger si tu es passée dans le
test hh>7 peut-etre
TotalMinute = TotalMinute + mm
If tb!MOIS = MonMois Then
If tb!NoOT <> num_OT Then
num_OT = tb!NoOT
tb.Edit
tb!nbint = 1
tb.Update
TotalHeure = 0
TotalMinute = 0
Nbintervention = 0
MonAction = tb!Action
MonDomaine = tb!domaine
hh = Left(tb![duree], 2)
mm = Right(tb![duree], 2)
If hh > 7 Then
Nbintervention = Nbintervention + tb!nbint + Fix(hh / 7)
Else
Nbintervention = Nbintervention + tb!nbint
End If
TotalHeure = TotalHeure + hh ' à corriger si tu es passée dans le
test hh>7 peut-etre
TotalMinute = TotalMinute + mm