CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Can't Get Birthdate to Show
Pages: [1]

Author Topic: Can't Get Birthdate to Show  (Read 1237 times)

scott.ward@fifthestateci

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.08
  • CMS version: joomla 1.7
  • MySQL version: 1.
  • PHP version: 2.0
Can't Get Birthdate to Show
July 03, 2012, 12:24:23 pm
Greetings all ... I've created a directory for my church that successfully matches individuals to households and allows me to include photos. (Please feel free to crib!) However ... For the life of my I can't get the Birthday field to show up. I've done numerous iterations, mostly focusing on treating the birthdate data more or less like the phone, etc. In this one, I tried to copy what was in the individual contact array. But nothing works. Anyone have a minute to look at this report and tell me what I'm doing wrong? Also happy just to separate out the Birthday modules. Thansk!

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Can't Get Birthdate to Show
July 03, 2012, 02:20:52 pm
Birthdate is part of the civicrm_contact table (unlike phone because people can have more than one phone so it's in a separate table). So you really should just be able to add the birthdate to the civicrm_contact array and that's it.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Can't Get Birthdate to Show
July 04, 2012, 12:42:06 am
Silly question perhaps, but have you debugged on your select to check that you ge the right data and birth_date is actually selected from the DB?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

scott.ward@fifthestateci

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.08
  • CMS version: joomla 1.7
  • MySQL version: 1.
  • PHP version: 2.0
Re: Can't Get Birthdate to Show
July 05, 2012, 10:55:53 am
Thanks ... I did debug and birth_date is the correct DB field. As to the suggestion to add this to the civicrm_contact array ... I did the following to no effect (admit I'm a total newbie here). Do I need to add a "left join" or "inner join" to make this work?

                  'civicrm_contact' =>
                  array( 'dao'       => 'CRM_Contact_DAO_Contact',
                         'fields'    =>
                         array( 'sort_name_a' =>
                                array( 'title'     => ts( 'Individual' ),
                                       'name'      => 'sort_name',
                                       'required'  => true,
                                       ),
                                'id' =>
                                array( 'no_display' => true,
                                       'required'   => true,
                                       ), ),
                         array( 'birth_date_a' =>
                                array( 'title'     => ts( 'Individual Birthday' ),
                                       'name'      => 'birth_date',
                                       'required'  => true,
                                       ),
                                       ),
                         'filters'    =>
                         array( 'sort_name_a'    =>
                                array( 'title'     => ts('Individual'),
                                       'name'      => 'sort_name',
                                       'operator'  => 'like',
                                       'type'      => CRM_Report_Form::OP_STRING ), ),
                         'grouping'   => 'contact_a_fields',
                         ),

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Can't Get Birthdate to Show
July 05, 2012, 10:59:44 am
Okay, what I meant is debug right at the end of the sql function so you check if the statement created is correct. You would probably need a LEFT JOIN if you start from civicrm_contact? LEFT JOIN means 'everything from the first table, show the linked from the other table if you can find it and blanks if you don't". INNER JOIN means show only if it can be linked in both tables. Does that make sense?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

scott.ward@fifthestateci

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.08
  • CMS version: joomla 1.7
  • MySQL version: 1.
  • PHP version: 2.0
Re: Can't Get Birthdate to Show
July 05, 2012, 11:32:50 am
Thansk so much to both of you ... Yes that makes sense adn I finally figured out what I was doing wrong!

Scott

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Can't Get Birthdate to Show
July 05, 2012, 12:15:27 pm
Glad it worked for you!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Can't Get Birthdate to Show

This forum was archived on 2017-11-26.