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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Update search function - allow numbers to be searched by range
Pages: [1]

Author Topic: Update search function - allow numbers to be searched by range  (Read 672 times)

narragansett

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.41
  • PHP version: 5.3.2-1
Update search function - allow numbers to be searched by range
November 28, 2011, 10:02:06 am
Our organization is member-run, and we require 18 'service hours' each year in addition to annual dues.  I set up a custom field to hold the current number of service hours each member has worked, but I did not set it to be searchable by range.

I just uploaded all the service hours we have on record, went to search to find out how many members have less than 18, and saw my mistake.  I modified the custom data field to be searchable, but when I go back to the search function I still do not see a way to enter a range.

How can I force this update to the custom field to show up in the search function?
Thanks!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Update search function - allow numbers to be searched by range
November 28, 2011, 11:02:54 am
Do you see a way to search on a single value for that field? I don't think the CiviCRM Advanced Search will allow you to search on a range, but you could achieve that with a Drupal View.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

narragansett

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.41
  • PHP version: 5.3.2-1
Re: Update search function - allow numbers to be searched by range
November 28, 2011, 11:08:53 am
Sorry, should have been more clear...

I am using the "Advanced Search" function - and yes, I can use that function to search on a range for the fields that were set up that way initially.  For example, we entered every member's "access badge" number (5 digit number) into the database, and I can search for all badges within a specified range...

I assume there is a way to do this, short of deleting the field & creating a replacement that is set up correctly from the start.  Or at least I hope there is...

Thanks!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Update search function - allow numbers to be searched by range
November 28, 2011, 11:16:31 am
I don't know if there is, but if you would create another field, setup correctly, then it's a very very simple SQL query to copy the values from the old to the new field. :)

Then you could delete the old field.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Update search function - allow numbers to be searched by range
November 28, 2011, 11:32:06 am
Actually, now that I look at the civicrm_custom_field table, it seems you could probably just manually set the is_search_range field to be 1 in the correct row for that field.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

narragansett

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.41
  • PHP version: 5.3.2-1
Re: Update search function - allow numbers to be searched by range
November 28, 2011, 12:53:07 pm
That did it!

Thank you very much - definitely easier than deleting & re-creating the field...  :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Update search function - allow numbers to be searched by range

This forum was archived on 2017-11-26.