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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Contact Addresses Separated Between Home/Main
Pages: [1]

Author Topic: Contact Addresses Separated Between Home/Main  (Read 594 times)

aaca

  • I’m new here
  • *
  • Posts: 23
  • Karma: 2
Contact Addresses Separated Between Home/Main
August 11, 2011, 02:11:34 pm
CiviCRM: 4.05
Drupal: 7.4

Importing contacts error with some of the address as home, some as main.  I see for some reason I had some as home, some as main on the import template. 

Main: State, Postal Code, Country
Home: Street, City, Country

How do I resolve this?  I'd like them all to be main.  How do I fix this easily and get rid of the home address?
« Last Edit: August 11, 2011, 02:17:21 pm by aaca »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Contact Addresses Separated Between Home/Main
August 11, 2011, 04:33:48 pm

from my IRC reply


[4:17pm] dlobo: easiest way might be to just run a couple of sql commands
[4:17pm] dlobo: the table is civicrm_address (and _email / _phone etc) and the field is location_type_id
[4:17pm] dlobo: so u can run an update statement on all those tables
[4:18pm] dlobo: argh
[4:18pm] dlobo: wont work
[4:18pm] dlobo: just read your blog post
[4:18pm] dlobo: forum post i mean
[4:20pm] dlobo: u'll probably need to merge the two address records into one, delete the other record and ensure all of them have the same location_type_id
[4:20pm] dlobo: should not be too hard in sql
[4:22pm]
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

aaca

  • I’m new here
  • *
  • Posts: 23
  • Karma: 2
Re: Contact Addresses Separated Between Home/Main
August 11, 2011, 06:24:11 pm
So far I did this:  It worked.

select  contact_id,GROUP_CONCAT(street_address)...
from civicrm_address
group by contact_id

Not sure how to delete the 2nd duplicate row with work ID yet.
« Last Edit: August 12, 2011, 07:10:04 am by aaca »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Contact Addresses Separated Between Home/Main

This forum was archived on 2017-11-26.