I have this error when I save the view:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_amount.uid' in 'field list'
and does not print the SUM of fields.

Any idea?

thanks...

Comments

sashkernel’s picture

Priority: Normal » Major

I encountered similar bug when trying to do sum of one column.

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= views_entity_node. WHERE (( (node.status = '1') AND (node.type IN ('points'))' at line 9

This module would be the most perfect fit to my table views if I manage to make it work.

KarenS’s picture

Status: Active » Fixed

This part of the code should be working now.

sashkernel’s picture

Thank you Karen
I'll test at first available opportunity

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jenyum’s picture

I am experiencing this error right now with the latest release, which appears to be newer than the dev release? Is there another release that I should be seeing?

jenyum’s picture

Status: Closed (fixed) » Active

changing status back to active. Tried dev version and can confirm that both latest recommended release and dev produce the error in #1 with integer fields.

gmgallag’s picture

Was there any solution to this. Currently experiencing the same error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AS sum__views_php_2 FROM dr_uc_orders uc_orders LEFT JOIN dr_users users ON u' at line 1

Note that I am trying to sum a column populated via Views PHP - not sure if this matters.

ibuildit’s picture

This happens only when the EDIT FIELD is in the view.

windmaomao’s picture

I confirmed as stated by #8, remove edit field and it works.

snowfly’s picture

Hi what do you mean by EDIT FIELD can you please point me out.

ibuildit’s picture

the field you add if you want an edit link to edit the content from the view

asiby’s picture

I do not have the EDIT LINK in my view and I am having the same issue.

Mark Schneider’s picture

Version: 7.x-1.x-dev » 7.x-1.0

I have this error message:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AS sum__views_php_2, SUM(field_data_field_cvt_count.field_cvt_count_value) AS ' at line 1

Note that I am trying to sum a column populated via Views PHP - not sure if this matters.

It's a little bit like the message in #7.

I don't understand the comment in #8.

Any ideas?

higherform’s picture

Issue summary: View changes

I can confirm that the presence of the "edit link" field can turn the error message in reply #1 on and off in my install. Using Views_calc-7.x-1.1 and views 7.11. The error does not appear in a different drupal install with only views 7.11 (not views_calc) with an edit link field.

apoc1’s picture

I can also confirm this. Both edit en delete views fields cause this error. Using a new install drupal 7.41 with Calc 7.x-1.1 Anyone ever found a solution to this?

gintass’s picture

I can confirm that adding "Edit" links generates the "SQLSTATE[42000]" errors and calculation is not working (it displays zero). Also if I have a "clone" field enabled (provided by Node Clone module), the error is not generated but clone links are not being displayed.