Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Homer Simpson coding puzzle
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00479329
Message ID:
00481127
Vues:
32
>>>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.
>>
>>:)
>
>Not so, l'il Bart ... you still need the CASE even if you get rid of the third option, since there is an implicit option (OTHERWISE) not listed. You'd need two IFs, preferably nested, to get rid of the CASE ...
>
>... or were you pulling our collective leg?
>zahid

No, you're indeed correct, there is the third implied condition, so you would need two IF's. So does this make you Lisa? < g >

>>
>>>
>>>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform