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

help with IFF statement in SELECT 1

Status
Not open for further replies.

Judi201

Technical User
Jul 2, 2005
315
US
Hi!

I just can't seem to get this. I have the following code in the old DOS FOX app I am reworking in VFP 6.0

Code:
IF shiptotl <= purtotl
   ordrreq = purtotl - shptotl + shipped
ELSE 
   ordrreq = shipped - (shptotl-purtotl)
   IF ordrreq < 0
       ordrreq = 0
   ENDIF 
ENDIF

I am trying to include this in a SELECT to set up a report. This is what I am trying; but even tho I don't get any kind of error, the cursor does not show 'ordrreq'

Code:
SUM(IFF((orders.shiptotl <= purtotl),;
    (purtotl - (shptotl + orders.shipped)), ;
    (orders.shipped -(shptotl - purtotl))))   AS ordrreg ;

I would really appreciate it if someone would give me a push in the right direction.

Thanks as always.

Judi
 
Well.....[blush] I meant IIF instead of IFF in the code above.
Sorry.

Judi
 
Mike,

I caught the error I posted on the IIF before I saw your reply , honestly ;) but not the 'q'. Glad to know I was thinking right, anyway.

Thanks for the sharp eyes and your time. I fixed that and it is working fine.

Judi

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top