Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sum fields in query
Message
 
 
To
15/11/2016 04:56:36
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01643456
Message ID:
01643463
Views:
34
>Thanks my professor,
>
>Now it has problem on this line
>
>select code as acc_code,  0 as op_qty, 0 as pr_qty, sum(qty) as sl_qty, 0 as sr_qty from cashsalp  where  code like '32%' and LEN(acc_code)=7
>       GROUP BY acc_code
>
>
>Msg 8120, Level 16, State 1, Line 10
>Column 'cashsalp.code' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
>

Nick corrected the typo I overlooked, but you should be able to figure out this yourself. Why do you want others to write code for you and you don't even try to correct such simple things yourself?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform