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) »
  • searching in custom date fields
Pages: [1]

Author Topic: searching in custom date fields  (Read 782 times)

marlutin

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
searching in custom date fields
May 21, 2010, 08:03:29 am
I have setup custom fields as "Date" I would find records with "empty" data on some of these dates, used as milestones.

As the advanced search interface does not allow direct typing a sql request, the only way I foud to match my request is to use "From --- To" dates. specifiyng low and high dates values, with no success.

Does anyone have some idea on how to manage advanced search on custom dates fields?
« Last Edit: May 21, 2010, 08:07:45 am by marlutin »

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: searching in custom date fields
May 21, 2010, 09:30:20 am

one thing which advanced search is lacking is the concept of "is null / is not null". For dates adding support for relative dates would also be great. basically u have 2 options IMO

1. Help extend advanced search so we can expose this. We can start with dates and custom fields of type date and get that working. This is a lot more involved but benefit you AND everyone else in the community

2. Write a custom search for your specific needs. This will be very focussed to the types of search you want to do, but a much shorter and quicker project

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

marlutin

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
Re: searching in custom date fields
May 21, 2010, 01:29:25 pm
Quote
1. Help extend advanced search so we can expose this
pls, could you tell me where to begin to help.

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: searching in custom date fields
May 21, 2010, 04:18:51 pm

assuming u r pretty comfortable with PHP5 / MySQL and OOP, you should start off with reading the book chapter:

http://en.flossmanuals.net/CiviCRM/DevelopIntro

For the advanced search stuff, u'll need to modify the Form and also the Query classes so that it understands IS NULL / IS NOT NULL

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • searching in custom date fields

This forum was archived on 2017-11-26.