6 Replies Latest reply on Jan 28, 2014 11:26 AM by erolst

    SQL in Data View works... Same code in script-- not

    synergy46

      I am using FM 13 Advanced

       

      I am admittedly new to sql. But, I need the 'distinct' function so I am giving it a go.

       

      I dloaded sqlexplorer and use the resulting code in the script below.

      Script purpose: I run a report which has a 'Filter' popup on it with Category choices.

      When a choice is made, the report if filtered by that choice. One person may

      be listed more than once. The report works.

       

      labels1.png

      What I am trying to do is to print Avery 5160 labels that show JUST ONE
      PERSON no matter how many times they are listed.

      (Fred Flintstone is listed TWICE)

       

      To that end I created a SQL query that, when pasted into the Data View

      shows the desired results.

       

      However, when I run the same code in ExecuteSQL I get duplicated

      names.

       

      The selected Category is held in $$MnuSelection. I have tried changing

      the SQL parameter to "$$MnuSelection" and $$MnuSelection and it fails

      both times in the code below

       

      What am I missing???

       

      Thanks

       

      Ron

      sql1of2.png

      sql2of2.png