Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sqlserver query
Message
From
04/08/2016 01:58:12
 
 
To
04/08/2016 01:42:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01639110
Message ID:
01639112
Views:
96
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
Previous
Reply
Map
View

Click here to load this message in the networking platform