Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sqlserver query
Message
De
04/08/2016 01:58:12
 
 
À
04/08/2016 01:42:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01639110
Message ID:
01639112
Vues:
91
This message has been marked as the solution to the initial question of the thread.
>Good Morning
>
>Sir following codes work fine in sqlserver as you can see in attached image
>but when I use in VFP as
>
>
>text TO m.cmd NOSHOW TEXTMERGE PRETEXT 7
>	select date,acc_code,sum(qty)as qty,rate,sum(qty*weight)as weight
>	sum(rate*qty)as cr_amount from sectsalp
>	where vou_type='SR' and type='P'
>	group by date,acc_code,rate
>	order by date,acc_code,rate
>ENDTEXT
>
>if sqlexec(con,cmd,'tableb')<0
>	aerror(laerror)
>	messagebox(laerror[1,2])
>	lok=.f.
>	return.f.
>endif
>
>
>It shows this error message
>
>Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'sum'.
>
>Why the same code work fine in SQLSERVER but not in vfp?
>
>Please help

Because it's not the same code. You missed a comma at the end of the first line.
----------------------------------
António Tavares Lopes
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform