OleDB Filter Syntax

 5 Replies
 0 Subscribed to this topic
 22 Subscribed to this forum
Sort:
Author
Messages
Jeff
Advanced Member
Posts: 30
Advanced Member
    I am using the Lawson Query Builder OleDB for first time and am trying to understand the syntax of the filter statement.

    Trying to read rows with a Major Class = 204 or 920

    This format does not return any rows:
    POLINE.PURCH-MAJCL = 204 or 920

    This format throws an error upon execution:
    POLINE.PURCH-MAJCL = 204 or POLINE.PURCH-MAJCL = 920

    Is there documentation for this tool somewhere?

    Any advice is appreciated.

    Jeff
    Jeff
    Advanced Member
    Posts: 30
    Advanced Member
      Bump.

      Have I stumped the crowd with this one?  Found documentation on MyLawson but it did not have any examples of compound filters.

      POLINE.PURCH-MAJCL = 204 works
      POLINE.PURCH-MAJCL = 920 works

      Just cannot get the OR condition to work.

      Anyone?

      Jeff
      State of NH
      Ruma Malhotra
      Veteran Member
      Posts: 412
      Veteran Member
        The filter should be in the format:

        POLINE.PURCH-MAJCL = 204 or POLINE.PURCH-MAJCL = 920

        Remember to use the conjunction and fileds form the command. If you type it in even a space may cause it to error out.

        What is the exact error you receive ?
        Jeff
        Advanced Member
        Posts: 30
        Advanced Member
          Ruma,

          Thanks for your reply. Copied and pasted your format into the filter with the following results. Had entered, clicked and pounded the same format, always with the same results. Documentation was useless. Won't comment any further on this product line.

          "An error message was returned from the IOS Data Service. The message is An unknown error occurred. Please contact your system admin."

          Have contacted our admins and they are also stumped. Heaven forbid if I were able to access the data directly versus being forced to use these 3GL query tools.

          Jeff
          State of NH
          Ruma Malhotra
          Veteran Member
          Posts: 412
          Veteran Member
            Have you checked to see the evrsions of oledb to make sure that you have the right oledb version installed. i have seen the error before where I did not have the right version of oledb installed. Also on product downloads on the Lawson support site you can click on your version and check whether there are any patches to your version of oledb. It will say latest patches and sometime I have installed oledb and then the patch downloaded from the support site.
            Again cutting and pasting may be an issue because there may be a space embedded that may cause the issue. You may have to rebuild your whole query from scratch and do type the or add it from conjunctions. If you are using the oledb to build a report then on set filter values you can slect the fields and conjunction and it should work. i have written an oledb filter where I am using or and and and it is working great for me.
            John Henley
            Posts: 3353
              &SELECT=POLINE.PURCH-MAJCL=204|POLINE.PURCH-MAJCL=920

              Change it on the bottom, where it's part of the DME command, and click 'parse', and it will change the filter syntax; you can then use 'Change filter'...
              Thanks for using the LawsonGuru.com forums!
              John