Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subquery
Message
From
10/08/2016 03:20:12
 
 
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:
01639295
Message ID:
01639298
Views:
58
sir now i have these codes
text TO query TEXTMERGE noshow

SELECT data.acc_code,data.acc_name,
sum(data.qty)as qty,
sum(data.cr_amount)as c_ramount
from (

SELECT distinct(acc_code) as acc_code ,max(acc_name) as acc_name, qty, cr_amount
	from crsalp where substring(acc_code,1,2)='32'  and type='P'

union all

SELECT distinct(acc_code) as acc_code ,max(acc_name) as acc_name, qty, cr_amount
	from cashsalp where substring(acc_code,1,2)='31'  and type='P'
) as data
group by
data.acc_code

ENDTEXT
but it says:

Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Column 'crsalp.acc_code' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform