Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sqlserver query
Message
De
04/08/2016 01:42:31
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Sqlserver query
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:
01639110
Vues:
74
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform