petiflamand
Messages postés675Date d'inscriptionsamedi 31 mai 2003StatutMembreDernière intervention26 mai 2013
-
20 févr. 2008 à 07:19
petiflamand
Messages postés675Date d'inscriptionsamedi 31 mai 2003StatutMembreDernière intervention26 mai 2013
-
21 févr. 2008 à 08:35
Bonjour , voici mon petit problême sur ce code si dessous ,
je fait une requete pour le total des plus et une dans le total des moins dans des tickets de caisse.
Quand il n'y a rien dans le Total des plus j'ai une erreur.
J' ai essayer avec ISNULL mais sa ne fonctionne pas , avez-vous une autre idée.
Merci
Set rd = db.OpenRecordset("select SUM(ticket.TOTAL) As TOTALPlus ,nticket from ticket WHERE ticket.nticket=" & toc & " and ticket.opa='+' group by nticket")
Set rr = db.OpenRecordset("select SUM(ticket.TOTAL) As TOTALMoin ,nticket FROM ticket WHERE ticket.nticket=" & toc & " and ticket.opa='-' group by nticket")
On Error GoTo erreur3
If IsNull(rd!totalplus) Then MsgBox "erreur"
If rr!TOTALmoin > 0 Then
MSFlexGrid1.Text = Format(rd!totalplus, "###0.00") - Format(rr!TOTALmoin, "###0.00")
Else
MSFlexGrid1.Text = Format(rd!totalplus, "###0.00")
End If
LIBRE_MAX
Messages postés1402Date d'inscriptionmardi 1 mai 2007StatutMembreDernière intervention 7 octobre 20126 20 févr. 2008 à 21:12
Salut,
places le IsNull dans l' expression de Format$
MSFlexGrid1.Text =
Format$( IIf(IsNull(rd!totalplus),0, rd!totalplus)- IIf(IsNull(rd!totalmoins),0, rd!totalplus) , "###0.00" )
<hr />
... Y'en a même qui disent qu'ils l'ont vu voler.
<hr />
/PRE>