We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    How do I express the where clause in this:

    select * from TABLE where LENGTH(COLUMN)  > 0
    

    in xPDO?

    $criteria->where(array('LENGTH(customer_po_num):>' => '0'));


    does not work, it results in something like this:

    `InventoryData`.`LENGTH(customer_po_num)` > '0' 
      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 26503
      • 620 Posts
      I wound up doing it like this:

      $criteria->where(
      array('`InventoryData`.`id` NOT IN (SELECT id FROM modx_gssi_inventory_data where LENGTH(customer_po_num) > 0)'));

      Not sure is that is the nicest way of doing it, but it works.
        *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

        Sean Kimball CLP, CLS.
        Technical Director / Sr. Developer | BigBlock Studios
        ._______________________________________________.
        Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
        27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
        phone/fax: 905-426-5525
        • 4172
        • 5,888 Posts
        something like this could work:

        $criteria->where(LENGTH(customer_po_num)>'0', xPDOQuery::SQL_AND);
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!