Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUM not giving correct result?

Status
Not open for further replies.

ulises48

Technical User
Feb 3, 2012
17
MX
Hello and good day.
Why this SUM code gives me only the value in the first field of my table?

PUBLIC xNumPedRec
xNumPedRec=ALLTRIM(THISFORM.numped1.VALUE)
SUM tblorders.totprod ALL for ALLTRIM(tblorders.numped)=xNumPedRec TO xRecalc
THISFORM.text1.VALUE=xRecalc (xRecalc here shows only the value of the first field in my table)

Thank you in advance
 
Never mind. I swear I did not touch the code and it's working now!!! :eek:

 
No matter, if the issue is solved overall or just solved for now:

The for condition "for ALLTRIM(tblorders.numped)=xNumPedRec" can limit the summing to only certain records.

So the result is influenced by what is entered in numped1.value of the form, you may want == instead of = here.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top