• HCMC Blogs
  • Moses
  • Maint
  • Mariage
  • Admin
  • Academic
  • Depts
  • ScanCan
  • HumsSites
  • Projects
  • Pro-D
  • ColDesp
  • CanMys
  • LondonMap
  • AdaptiveDB
  • MoM
  • Cascade
  • Landscapes
  • Linguistics
  • CGWP
  • Endings
  • LEMDO
  • DVPP
  • Wendat
  • Announcements

Contact Us on 0800 123 4567 or info@example.com

German Medical Exams

  • Front Page
  • Contact
  • Log in
  • « allow for AND or OR operator within multiselect fields
  • add filter for Has Nurse or Support Care »

query fails when more than one item selected in multiselect fields

Posted by sarneil on 24 Jun 2010 in Activity log

MLH told me that if he did queries involving more than one choice in a multiselect field, the results coming back were wrong. For example,
If I search for remedy = bloodletting, I get 23 results
If I search for remedy = purge, I get 52 results
Before, when I searched for remedy = bloodletting OR purge I got 0 hits.

Problem was with code that generates the where clause in the SQL query, in particular where that code has to search 2 fields. It was generating a clause like this:
((remedy1 = "bloodletting OR purge") OR (remedy2 = "bloodletting OR purge"))
and so I corrected it to create a clause like this:
(((remedy1 = "bloodletting") OR (remedy1 = "purge")) OR ((remedy2 = "bloodletting") OR (remedy2 = "purge")))

Now, when I search for remedy = bloodletting OR purge, I get 58 hits.

This entry was posted by Stewart and filed under Activity log.

German Medical Exams

This project will create an xml-based database of medical exam reports from the 16th through 19th centuries in Germany. The database will allow researchers to query medical practices in that time and to infer changes in the administration of medical care and other social changes.
  • Home
  • Recently
  • Archives
  • Categories
  • Latest comments

Search

Categories

  • All
  • Activity log
  • Announcements
  • Tasks

XML Feeds

  • RSS 2.0: Posts
  • Atom: Posts
What is RSS?

Recent Posts

  • allow for AND or OR operator within multiselect fields
  • query fails when more than one item selected in multiselect fields
  • add filter for Has Nurse or Support Care
  • add another search, one still to go
  • update order-by control
  • Add search of treatments textarea
  • Add search of conditions textarea, new report presentation to follow
  • change which fields appear in report
  • fix couple of bugs in sql
  • fix errors in dropdown lists

Sidebar 2

This is the "Sidebar 2" container. You can place any widget you like in here. In the evo toolbar at the top of this page, select "Customize", then "Blog Widgets".

This collection ©2026 by admin • Help • Community CMS