On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • 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
    • 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
      • 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
        • 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
          • 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