Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference SQL and VFP
Message
De
08/02/1999 06:01:25
 
 
À
08/02/1999 05:44:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00184820
Message ID:
00185002
Vues:
27
>>>I am converting a program from VFP to SQL with ado.
>>>
>>>I seems that the sql statements are not compatible.
>>>The SUM with an IIF statement does not give the correct result
>>>
>>>Example
>>>
>>>select *, sum(uurfact) as fact, SUM(IIF(ureisk='Ja ',1,0)) as reisk from uren where umcode= '20002 ' group by umcode
>>>
>>>Can someone help me.
>>>
>>>Kind regards
>>>
>>>
>>>Jan Dorresteijn
>>
>>IIF is a VFP command and not recognized by SQL Server.
>
>OK but is there an other solution
>
>Kind regards,
>
>Jan

Hi Jan,

There may be two solutions. One lengthy, and the other a little more tricky.

1) You get your core data into a VFP cursor (without the grouping) and then run your SQL, so it then becomes a native VFP call, or,

2) You write a stored procedure in SQL Server and make a call to run that stored procedure in the server.

Rgds,

Sanjay
Sanjay Kapoor

Relatively speaking is a conversation with Einstein
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform