Answers.Body: <p>For some reason i am getting different no such field error i.e for contact.birth_date. I have locked the issue for this error at <a href="https://lab.civicrm.org/dev/core/issues/325" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/issues/325</a> and submitted PR at <a href="https://github.com/civicrm/civicrm-core/pull/12660" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/12660</a> . </p>
  
  <p>I also logged issue for your bug at <a href="https://lab.civicrm.org/dev/core/issues/326" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/issues/326</a>  which happens when we enable Section header under sorting tab. </p>
  
  <p>To fix this temporary until Core team have PR for it, i would suggest you to turn off section header.</p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T15:14:05.683Z
Answers.Text: Interesting. I could replicate this on a French language 5.0 version on civicrm.org
Answers.UserDisplayName: Tom Crawshaw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T15:20:08.113Z
Answers.Text: On French site the error is for 'contact.birth_date' which i have fixed it in my PR. I could replicate the error you getting now. I have updated my answer
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T15:25:37.440Z
Answers.Text: Interesting. I could replicate this on a French language 5.3.1 version on civicrm.org. (as above), by logging in (demo/demo) -> choose CiviCRM -> choose "Rapport des contributions" -> Choose "Contribution details" then "Rafraichir le resultats"... Gives: DB Error. Turning off Section Header had not impact. Still errored.
Answers.UserDisplayName: Tom Crawshaw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T15:35:37.600Z
Answers.Text: Can you turn off 'Age' and 'Sexe' field under columns and try doing a search without section header?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T17:17:31.623Z
Answers.Text: I've turned off all optional columns and section header, but still get the error.
Answers.UserDisplayName: Tom Crawshaw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T17:21:22.013Z
Answers.Text: I am not sure how you doing this. I turned off the section header from sorting tab and 'Age' and 'Sexe' field under columns tab it worked for me in french site. So can you be specific with 'I've turned off all optional columns and section header'?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T22:28:48.553Z
Answers.Text: Sorry, I had tried turning off all columns in my demo system, not French system. On French demo system turning off Sexe cures error as you say. However, I am running 5.4.0, not 5.3.1 as on French system, so maybe another problem been introduced?
Answers.UserDisplayName: Tom Crawshaw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T23:17:46.550Z
Answers.Text: What error you get?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-15T08:59:07.007Z
Answers.Text: Probably worth rebuilding Multi-lingual schema since there were lot of issues for multi-lingual site after upgrade https://civicrm.stackexchange.com/a/25890/155
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-15T09:02:49.300Z
Answers.Text: Pradeep, is there an easier/better way than comments to send an error log?
Answers.UserDisplayName: Tom Crawshaw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-15T09:11:18.117Z
Answers.Text: I have added my email id on my profile. You can send me there.
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T14:53:34.527Z
Answers.LastActivityDate: 2018-08-14T15:21:57.603Z
Answers.LastEditDate: 2018-08-14T15:21:57.603Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>After upgrade to 5.4.0 (from 4.7) I'm seeing fatal DB errors ("no such field") when refreshing Contribution Detail &amp; Summary reports. Debug log shows:</p>
  
  <blockquote>
    <p>$Fatal Error Details = Array ( [callback] => Array ( [0] =>
    CRM_Core_Error [1] => handle ) [code] => -19 [message] => DB Error: no
    such field [mode] => 16 [debug_info] => SELECT
    ifnull(civicrm_contribution_financial_type_id, '') as
    civicrm_contribution_financial_type_id,
    ifnull(civicrm_contribution_payment_instrument_id, '') as
    civicrm_contribution_payment_instrument_id,
    ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name,
    ifnull(civicrm_contact_id, '') as civicrm_contact_id,
    ifnull(civicrm_contribution_contribution_id, '') as
    civicrm_contribution_contribution_id,
    ifnull(civicrm_contribution_financial_type_id, '') as
    civicrm_contribution_financial_type_id,
    ifnull(civicrm_contribution_payment_instrument_id, '') as
    civicrm_contribution_payment_instrument_id,
    ifnull(civicrm_contribution_currency, '') as
    civicrm_contribution_currency,
    ifnull(civicrm_contribution_receive_date, '') as
    civicrm_contribution_receive_date,
    ifnull(civicrm_contribution_total_amount, '') as
    civicrm_contribution_total_amount,
    ifnull(civicrm_contribution_fee_amount, '') as
    civicrm_contribution_fee_amount,
    ifnull(civicrm_contribution_net_amount, '') as
    civicrm_contribution_net_amount,
    ifnull(civicrm_contribution_contribution_or_soft, '') as
    civicrm_contribution_contribution_or_soft,
    ifnull(civicrm_contribution_campaign_id, '') as
    civicrm_contribution_campaign_id,
    ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as
    civicrm_value_gift_aid_declaration_custom_25,
    ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as
    civicrm_value_gift_aid_declaration_custom_26,
    ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as
    civicrm_value_gift_aid_declaration_custom_27 ,
    sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct
    from civireport_contribution_detail_temp3 group by
    civicrm_contribution_financial_type_id,
    civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown
    column 'civicrm_contribution_total_amount' in 'field list'] [type] =>
    DB_Error [user_info] => SELECT
    ifnull(civicrm_contribution_financial_type_id, '') as
    civicrm_contribution_financial_type_id,
    ifnull(civicrm_contribution_payment_instrument_id, '') as
    civicrm_contribution_payment_instrument_id,
    ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name,
    ifnull(civicrm_contact_id, '') as civicrm_contact_id,
    ifnull(civicrm_contribution_contribution_id, '') as
    civicrm_contribution_contribution_id,
    ifnull(civicrm_contribution_financial_type_id, '') as
    civicrm_contribution_financial_type_id,
    ifnull(civicrm_contribution_payment_instrument_id, '') as
    civicrm_contribution_payment_instrument_id,
    ifnull(civicrm_contribution_currency, '') as
    civicrm_contribution_currency,
    ifnull(civicrm_contribution_receive_date, '') as
    civicrm_contribution_receive_date,
    ifnull(civicrm_contribution_total_amount, '') as
    civicrm_contribution_total_amount,
    ifnull(civicrm_contribution_fee_amount, '') as
    civicrm_contribution_fee_amount,
    ifnull(civicrm_contribution_net_amount, '') as
    civicrm_contribution_net_amount,
    ifnull(civicrm_contribution_contribution_or_soft, '') as
    civicrm_contribution_contribution_or_soft,
    ifnull(civicrm_contribution_campaign_id, '') as
    civicrm_contribution_campaign_id,
    ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as
    civicrm_value_gift_aid_declaration_custom_25,
    ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as
    civicrm_value_gift_aid_declaration_custom_26,
    ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as
    civicrm_value_gift_aid_declaration_custom_27 ,
    sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct
    from civireport_contribution_detail_temp3 group by
    civicrm_contribution_financial_type_id,
    civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown
    column 'civicrm_contribution_total_amount' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19
    mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT
    ifnull(civicrm_contribution_financial_type_id, '') as
    civicrm_contribution_financial_type_id,
    ifnull(civicrm_contribution_payment_instrument_id, '') as
    civicrm_contribution_payment_instrument_id,
    ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name,
    ifnull(civicrm_contact_id, '') as civicrm_contact_id,
    ifnull(civicrm_contribution_contribution_id, '') as
    civicrm_contribution_contribution_id,
    ifnull(civicrm_contribution_financial_type_id, '') as
    civicrm_contribution_financial_type_id,
    ifnull(civicrm_contribution_payment_instrument_id, '') as
    civicrm_contribution_payment_instrument_id,
    ifnull(civicrm_contribution_currency, '') as
    civicrm_contribution_currency,
    ifnull(civicrm_contribution_receive_date, '') as
    civicrm_contribution_receive_date,
    ifnull(civicrm_contribution_total_amount, '') as
    civicrm_contribution_total_amount,
    ifnull(civicrm_contribution_fee_amount, '') as
    civicrm_contribution_fee_amount,
    ifnull(civicrm_contribution_net_amount, '') as
    civicrm_contribution_net_amount,
    ifnull(civicrm_contribution_contribution_or_soft, '') as
    civicrm_contribution_contribution_or_soft,
    ifnull(civicrm_contribution_campaign_id, '') as
    civicrm_contribution_campaign_id,
    ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as
    civicrm_value_gift_aid_declaration_custom_25,
    ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as
    civicrm_value_gift_aid_declaration_custom_26,
    ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as
    civicrm_value_gift_aid_declaration_custom_27 ,
    sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct
    from civireport_contribution_detail_temp3 group by
    civicrm_contribution_financial_type_id,
    civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown
    column 'civicrm_contribution_total_amount' in 'field list']"] )</p>
  </blockquote>
  
  <p>Key issue seems to be that civicrm_contribution_total_amount is not included in temp table civireport_contribution_detail_temp3</p>
  
  <p>Checked on a 5.0 demo site listed on civicrm.org (<a href="https://drupal.demo.civicrmfr.org/civicrm/report/list?compid=2&amp;reset=1" rel="nofollow noreferrer">https://drupal.demo.civicrmfr.org/civicrm/report/list?compid=2&amp;reset=1</a> - the only one running 5.x) and get the same error.</p>
  
  <p>Any help gratefully received...</p>
  
Tags: <error><contributions><database><reports><5.0>
Title: DB error missing field in contribution reports after upgrade to 5.4.0 (Drupal)
ThreadText: # DB error missing field in contribution reports after upgrade to 5.4.0 (Drupal)
  
  (Asked by: username_0 on 2018-08-14)
  
  After upgrade to 5.4.0 (from 4.7) I'm seeing fatal DB errors ("no such field") when refreshing Contribution Detail & Summary reports. Debug log shows:
  
  > $Fatal Error Details = Array ( [callback] => Array ( [0] =>
  > CRM\_Core\_Error [1] => handle ) [code] => -19 [message] => DB Error: no
  > such field [mode] => 16 [debug\_info] => SELECT
  > ifnull(civicrm\_contribution\_financial\_type\_id, '') as
  > civicrm\_contribution\_financial\_type\_id,
  > ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as
  > civicrm\_contribution\_payment\_instrument\_id,
  > ifnull(civicrm\_contact\_sort\_name, '') as civicrm\_contact\_sort\_name,
  > ifnull(civicrm\_contact\_id, '') as civicrm\_contact\_id,
  > ifnull(civicrm\_contribution\_contribution\_id, '') as
  > civicrm\_contribution\_contribution\_id,
  > ifnull(civicrm\_contribution\_financial\_type\_id, '') as
  > civicrm\_contribution\_financial\_type\_id,
  > ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as
  > civicrm\_contribution\_payment\_instrument\_id,
  > ifnull(civicrm\_contribution\_currency, '') as
  > civicrm\_contribution\_currency,
  > ifnull(civicrm\_contribution\_receive\_date, '') as
  > civicrm\_contribution\_receive\_date,
  > ifnull(civicrm\_contribution\_total\_amount, '') as
  > civicrm\_contribution\_total\_amount,
  > ifnull(civicrm\_contribution\_fee\_amount, '') as
  > civicrm\_contribution\_fee\_amount,
  > ifnull(civicrm\_contribution\_net\_amount, '') as
  > civicrm\_contribution\_net\_amount,
  > ifnull(civicrm\_contribution\_contribution\_or\_soft, '') as
  > civicrm\_contribution\_contribution\_or\_soft,
  > ifnull(civicrm\_contribution\_campaign\_id, '') as
  > civicrm\_contribution\_campaign\_id,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_25, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_25,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_26, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_26,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_27, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_27 ,
  > sum(civicrm\_contribution\_total\_amount) as sumcontribs, count(\*) as ct
  > from civireport\_contribution\_detail\_temp3 group by
  > civicrm\_contribution\_financial\_type\_id,
  > civicrm\_contribution\_payment\_instrument\_id [nativecode=1054 \*\* Unknown
  > column 'civicrm\_contribution\_total\_amount' in 'field list'] [type] =>
  > DB\_Error [user\_info] => SELECT
  > ifnull(civicrm\_contribution\_financial\_type\_id, '') as
  > civicrm\_contribution\_financial\_type\_id,
  > ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as
  > civicrm\_contribution\_payment\_instrument\_id,
  > ifnull(civicrm\_contact\_sort\_name, '') as civicrm\_contact\_sort\_name,
  > ifnull(civicrm\_contact\_id, '') as civicrm\_contact\_id,
  > ifnull(civicrm\_contribution\_contribution\_id, '') as
  > civicrm\_contribution\_contribution\_id,
  > ifnull(civicrm\_contribution\_financial\_type\_id, '') as
  > civicrm\_contribution\_financial\_type\_id,
  > ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as
  > civicrm\_contribution\_payment\_instrument\_id,
  > ifnull(civicrm\_contribution\_currency, '') as
  > civicrm\_contribution\_currency,
  > ifnull(civicrm\_contribution\_receive\_date, '') as
  > civicrm\_contribution\_receive\_date,
  > ifnull(civicrm\_contribution\_total\_amount, '') as
  > civicrm\_contribution\_total\_amount,
  > ifnull(civicrm\_contribution\_fee\_amount, '') as
  > civicrm\_contribution\_fee\_amount,
  > ifnull(civicrm\_contribution\_net\_amount, '') as
  > civicrm\_contribution\_net\_amount,
  > ifnull(civicrm\_contribution\_contribution\_or\_soft, '') as
  > civicrm\_contribution\_contribution\_or\_soft,
  > ifnull(civicrm\_contribution\_campaign\_id, '') as
  > civicrm\_contribution\_campaign\_id,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_25, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_25,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_26, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_26,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_27, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_27 ,
  > sum(civicrm\_contribution\_total\_amount) as sumcontribs, count(\*) as ct
  > from civireport\_contribution\_detail\_temp3 group by
  > civicrm\_contribution\_financial\_type\_id,
  > civicrm\_contribution\_payment\_instrument\_id [nativecode=1054 \*\* Unknown
  > column 'civicrm\_contribution\_total\_amount' in 'field list']
  > [to\_string] => [db\_error: message="DB Error: no such field" code=-19
  > mode=callback callback=CRM\_Core\_Error::handle prefix="" info="SELECT
  > ifnull(civicrm\_contribution\_financial\_type\_id, '') as
  > civicrm\_contribution\_financial\_type\_id,
  > ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as
  > civicrm\_contribution\_payment\_instrument\_id,
  > ifnull(civicrm\_contact\_sort\_name, '') as civicrm\_contact\_sort\_name,
  > ifnull(civicrm\_contact\_id, '') as civicrm\_contact\_id,
  > ifnull(civicrm\_contribution\_contribution\_id, '') as
  > civicrm\_contribution\_contribution\_id,
  > ifnull(civicrm\_contribution\_financial\_type\_id, '') as
  > civicrm\_contribution\_financial\_type\_id,
  > ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as
  > civicrm\_contribution\_payment\_instrument\_id,
  > ifnull(civicrm\_contribution\_currency, '') as
  > civicrm\_contribution\_currency,
  > ifnull(civicrm\_contribution\_receive\_date, '') as
  > civicrm\_contribution\_receive\_date,
  > ifnull(civicrm\_contribution\_total\_amount, '') as
  > civicrm\_contribution\_total\_amount,
  > ifnull(civicrm\_contribution\_fee\_amount, '') as
  > civicrm\_contribution\_fee\_amount,
  > ifnull(civicrm\_contribution\_net\_amount, '') as
  > civicrm\_contribution\_net\_amount,
  > ifnull(civicrm\_contribution\_contribution\_or\_soft, '') as
  > civicrm\_contribution\_contribution\_or\_soft,
  > ifnull(civicrm\_contribution\_campaign\_id, '') as
  > civicrm\_contribution\_campaign\_id,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_25, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_25,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_26, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_26,
  > ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_27, '') as
  > civicrm\_value\_gift\_aid\_declaration\_custom\_27 ,
  > sum(civicrm\_contribution\_total\_amount) as sumcontribs, count(\*) as ct
  > from civireport\_contribution\_detail\_temp3 group by
  > civicrm\_contribution\_financial\_type\_id,
  > civicrm\_contribution\_payment\_instrument\_id [nativecode=1054 \*\* Unknown
  > column 'civicrm\_contribution\_total\_amount' in 'field list']"] )
  
  Key issue seems to be that civicrm\_contribution\_total\_amount is not included in temp table civireport\_contribution\_detail\_temp3
  
  Checked on a 5.0 demo site listed on civicrm.org (<https://drupal.demo.civicrmfr.org/civicrm/report/list?compid=2&reset=1> - the only one running 5.x) and get the same error.
  
  Any help gratefully received...
  
  **Tags:** error, contributions, database, reports, 5.0
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-08-14. Score: 0
  
  For some reason i am getting different no such field error i.e for contact.birth\_date. I have locked the issue for this error at <https://lab.civicrm.org/dev/core/issues/325> and submitted PR at <https://github.com/civicrm/civicrm-core/pull/12660> .
  
  I also logged issue for your bug at <https://lab.civicrm.org/dev/core/issues/326> which happens when we enable Section header under sorting tab.
  
  To fix this temporary until Core team have PR for it, i would suggest you to turn off section header.
  
  HTH
  
  username_1
  
  > **Comments:**
  > **username_0**: Interesting. I could replicate this on a French language 5.0 version on civicrm.org  
  > **username_1**: On French site the error is for 'contact.birth_date' which i have fixed it in my PR. I could replicate the error you getting now. I have updated my answer  
  > **username_0**: Interesting. I could replicate this on a French language 5.3.1 version on civicrm.org. (as above), by logging in (demo/demo) -> choose CiviCRM -> choose "Rapport des contributions" -> Choose "Contribution details" then "Rafraichir le resultats"... Gives: DB Error. Turning off Section Header had not impact. Still errored.  
  > **username_1**: Can you turn off 'Age' and 'Sexe' field under columns and try doing a search without section header?  
  > **username_0**: I've turned off all optional columns and section header, but still get the error.  
  > **username_1**: I am not sure how you doing this. I turned off the section header from sorting tab and 'Age' and 'Sexe' field under columns tab it worked for me in french site. So can you be specific with 'I've turned off all optional columns and section header'?  
  > **username_0**: Sorry, I had tried turning off all columns in my demo system, not French system. On French demo system turning off Sexe cures error as you say. However, I am running 5.4.0, not 5.3.1 as on French system, so maybe another problem been introduced?  
  > **username_1**: What error you get?  
  > **username_1**: Probably worth rebuilding Multi-lingual schema since there were lot of issues for multi-lingual site after upgrade https://civicrm.stackexchange.com/a/25890/155  
  > **username_0**: username_1, is there an easier/better way than comments to send an error log?  
  > **username_1**: I have added my email id on my profile. You can send me there.  
  
  ---
  
  