We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Examining the pdoTools function for handling "where" and "having" properties is quite interesting. You'll find it in the pdofetch.class.php file.
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 53699
      • 22 Posts
      Iam running modx on ubuntu machine.
      [[!Rowboat? 
      &table=`[[++table_prefix]]site_tmplvar_contentvalues` 
      &tpl=`test_tpl` 
      &limit=`0` 
      &columns=`{"DATE_FORMAT(value,'%Y-%m-01') ":"seminar_month_value"," DATE_FORMAT(value,'%M, %Y')":"seminar_month_name"}`
      &debug=`1`
      &sortBy=`value`
      &cacheResults=`0`
      &where=`{"tmplvarid:=":7}`
      ]]

      this code is working fine. But if I change
      &columns=`{"DISTINCT DATE_FORMAT(value,'%Y-%m-01')  ":"seminar_month_value","DATE_FORMAT(value,'%M, %Y')":"seminar_month_name"}`
      

      It is running no results.
      query generated.
       	SELECT DISTINCT DATE_FORMAT(value,'%Y-%m-01') AS `seminar_month_value`, DATE_FORMAT(value,'%M, %Y') AS `seminar_month_name` FROM `modx_site_tmplvar_contentvalues`
      WHERE `tmplvarid` = 7
      ORDER BY `value` ASC

      While running same code in local windows system it is working fine. Please guide me how to add distinct in rowBoat
        • 3749
        • 24,544 Posts
        Do you have the same version of MODX in both places? IIRC, in earlier versions of MODX, XPDO doesn't support DISTINCT queries.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 53699
          • 22 Posts
          server version ,
          (
              [MODx version] => 2.5.7-pl
              [Php version] => 5.6.31-4+ubuntu16.04.1+deb.sury.org+4
              [MySql version] => 5.7.19-0ubuntu0.16.04.1
              [AdvSearch version] => 2.0.0 beta2
          )


          local
          [AdvSearch] System environment: Array
          (
              [MODx version] => 2.5.7-pl
              [Php version] => 5.6.31
              [MySql version] => 10.1.25-MariaDB
              [AdvSearch version] => 2.0.0 beta2
          )

          any php setting need to be enabled. Other than this rest of functionality seems working fine. Please guide me
            • 3749
            • 24,544 Posts
            I'm afraid I can't think of any other reason than the DB engine, though it would be very weird if distinct queries worked on MariaDB and not the more common engines.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting