1 Reply Latest reply on Dec 29, 2008 1:29 PM by dizmarkie

    How do I filter recordset by more then one field? PEASE HELP!

      Ok, I have an "active" field in my db which i have an enum field type as "Y","N"

      I have built an admin section for the client to use a check box to turn this value to either "y" or "n"

      On the front end I added a condition region to the repeat region object stating that that the record is only to show if its "active" value equals "Y"

      this works great for hiding records, however.. the recordset the repeat region is using is using a filter method other then the "active" field. It us using a foreign key for a category table I have.

      When I use recordset paging, the recordset paging still counts the records that have a "N" value in their active field. How do I filter my recordset by the current URL parameter I am using and to only show records that have a "n" value in the "active" field

      thanks so much for who ever can help me.
        • 1. Re: How do I filter recordset by more then one field? PEASE HELP!
          dizmarkie Level 1
          OK, I'm sure most people didn't respond because of how newbie the question was...

          I was able to get it working by defining and advanced recordset and adding a variable.

          I created a simple recordset and filtered how i needed to by url parameter. Then switched to advanced mode to add the 2nd filter

          my recordset looked like this:

          SELECT *
          FROM tbl_products
          WHERE fk_subcategory = colname AND tbl_products.active = varproductactive
          ORDER BY sort_order ASC

          then i added 2 variables which looked like this

          1st variable
          default value: -1
          runtime value: $_GET['fk_subcategory']

          2nd variable
          default value:Y
          runtime value:$row_rsproducts['active']

          now when i use recordset paging on this page, it only shows records that have a Y value in the "active" field for that records. I was using a condition region to show if the value = Y but this would only hide the record itself. the recordset paging still counted all records even if they had an N value in active.

          hope this helps anyone on the rookie side of things like me