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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking Criteria/Formula

Status
Not open for further replies.

ozgirl

IS-IT--Management
Oct 15, 2003
8
0
0
AU
Does the following look right. As a double check I combined the first two programs and made the condition =>2 and I get different numbers to when I run them as below

SELE TEMP.ORDER_NO,TEMP.RECALL,POSTCODE.LEADTIME FROM TEMP,POSTCODE ;
WHERE TEMP.PCODE=POSTCODE.POSTCODE AND POSTCODE.LEADTIME=>3 GROUP BY TEMP.ORDER_NO INTO CURSOR TEMP1

SELE TEMP.ORDER_NO,TEMP.RECALL,POSTCODE.LEADTIME FROM TEMP,POSTCODE ;
WHERE TEMP.PCODE=POSTCODE.POSTCODE AND POSTCODE.LEADTIME==2 GROUP BY TEMP.ORDER_NO INTO CURSOR TEMP1

I look forward to someone helping me.

Thank you
Katie
 
Hi Katie,

In the command only difference I find is, in the conditions for LEADTIME. What is your requirement ?

1) =>3 will include all records having leadtime 3,4,5, etc.
2) ==2 will include those having exactly 2 and no other.
3) =>2 will fetch 2,3,4 and so on.

Decide your requirement first.

A word of caution - it is dangerous to name a field as 'RECALL'. It is the reserved word.

Puru
 
Not sure what you think might be wrong, but two observations:

1. You're using a GROUP BY clause with no aggregate functions. This is not standard SQL and while it works in VFP7 and earlier versions, it will give you an error in VFP8. GROUP BY is used to compute totals, counts, and the like. Use SELECT DISTINCT instead and eliminate the GROUP BY.
2. In the second select's WHERE clause, you're using "==" to compare a numeric field. "==" is only meaningful for string comparisons. While it works identically to "=" for numeric comparisons, I'm wondering if it's a typo and you actually meant to say "=>" like you did the first select.

Other than that it looks OK to me.

Mike Krausnick
Dublin, California
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top