>hi all
>I have the following code that is giving a variable not found error on line 2
>
>SELECT tempsorders
>SUM ordqty TO mhistory FOR period > (mperiod-12) AND stkref = mstkref AND stage > "20"
>
>tempsorders contains all of the fields in the sum line and all are named correctly, any ideas?
>~M
Re-check each and every part that may be a field or variable (VFP doesn't know what it is supposed to be, of course).
Divide the command into simpler parts, to identify the error. This may help find the culprit. For example, run the following commands one after the other, from the command line:
SUM ordqty
SUM ordqty TO mhistory
SUM ordqty TO mhistory FOR period > (mperiod-12)
SUM ordqty TO mhistory FOR period > (mperiod-12) AND stkref = mstkref
SUM ordqty TO mhistory FOR period > (mperiod-12) AND stkref = mstkref AND stage > "20"
This should narrow your search for the offending part.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)