Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Homer Simpson coding puzzle
Message
From
26/02/2001 03:20:02
 
 
To
26/02/2001 00:33:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00479329
Message ID:
00479409
Views:
30
>OK, OK --- Ya got me ... and Zahid had a good idea about placement of the options.

Actually, you don't even need your third option (at least with that query).

With only the two cases, you could write it as an IF.

And instead of using RECCOUNT(), I'd store _TALLY to a variable and use that to check if any records were SELECTed.

:)

>
>>>Hey all. Simple test of the "doh!" principle here: The question is 'What will end up being printed on the screen?' .. Yes, I know the answer - just testing y'all :-)
>>>
>>>And, no, it's not the GenPrimary() UDF
>>>
>>>
>>>OPEN DATA foomeister
>>>CREATE TABLE foo (pk C(30) PRIMARY KEY,amount N(10,2),quantity N(4,0))
>>>INSERT INTO foo (pk,amount,quantity) VALUES (GenPrimary(),100.15,1)
>>>SELECT * FROM foo WHERE amount > 200 INTO CURSOR foobaby
>>>SELECT foobaby
>>>DO CASE
>>>CASE foobaby.amount = 0.00
>>>  ?"No Sale"
>>>CASE RECCOUNT('foobaby') = 0
>>>  ?"No records"
>>>CASE foobaby.amount <= 200
>>>  ?"Small spender"
>>>ENDCASE
>>
>>"No Sale"
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform