Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Flag for a value in a list
Message
De
15/01/2000 07:14:49
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00318140
Message ID:
00318519
Vues:
14
>>10 entries of Rep,month,pub
>>
>>Sele Rep,iif(pub="SA",.T.,.F.) as SA_flag Group by Rep
>>
>>I want to flag those reps who worked on the SA pub, while also selecting the list of reps. Will this statement work? (in testing, it appears to work) My concern is that if another pub value occurs in the selection after the "SA" value, that the SA_flag value will return to the .F. state.
>
>Hi Michael,
> Try: SELECT Rep, SUM(IIF(pub="SA",1,0)) AS SA_Flag GROUP BY Rep
> The SA_Flag will be 0 if none of the pub values are "SA" and >0 otherwise.
>
>HTH


Seems like I was the last one to think of this one :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform