Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP-SQL translation
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00749711
Message ID:
00749746
Vues:
31
This message has been marked as a message which has helped to the initial question of the thread.
Hi Nadya

May be IIFwas impreded you. I had not tested this, but this is syntax, that you need instead of IIF
SELECT MainInfo.*, ;
sum(CASE MainInfo.Category WHEN "1" THEN 1 ELSE 0) as Category1Count, ;
sum(CASE MainInfo.Category WHEN "2" THEN 1 ELSE 0) as Category2Count ;
from MainInfo inner join NamesInfo ;
on MainInfo.CrediID = NamesInfo.CrediID ;
where MainInfo.ccode = "01" and ;
MainInfo.town in (select Town from SelectedTowns) ;
and NamesInfo.LastName like ?NameInput ;
group by MainInfo.CredID into cursor curResult
>Hi everybody,
>
>How this VFP SQL will look in SQL Server:
>
>SELECT MainInfo.*, ;
>sum(iif(MainInfo.Category = "1",1,0)) as Category1Count, ;
>sum(iif(MainInfo.Category = "2",1,0)) as Category2Count ;
>from MainInfo inner join NamesInfo ;
>on MainInfo.CrediID = NamesInfo.CrediID ;
>where MainInfo.ccode = "01" and ;
>MainInfo.town in (select Town from SelectedTowns) ;
>and NamesInfo.LastName like ?NameInput ;
>group by MainInfo.CredID into cursor curResult
>
>Thanks a lot in advance.
Venelina Jordanova

Outsourcing IT Services Ltd.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform