Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Compound Query??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Compound Query??

    This query filter works:

    query.filter ="ACCOUNT_NUMBR="600655".AND.(ACCTITEMS->TYPE="deposit".OR.ACCTITEMS->TYPE="cashed".OR.ACCTITEMS->TYPE="begin balance").AND.PAYEE"patti".AND.PAYEE"john".AND.PAYOR"elizabeth".AND.PAYOR"equitable".AND.PAYOR"edwin""

    I want to add another Acct # to the query and only include the field TYPE value of Begin Balance. I've tried adding: .AND."(ACCOUNT_NUMBR="600663".AND.ACCTITEMS->TYPE="begin balance")" to the end of the expression as shown below but can't get it to work.

    query.filter ="ACCOUNT_NUMBR="600655".AND.(ACCTITEMS->TYPE="deposit".OR.ACCTITEMS->TYPE="cashed".OR.ACCTITEMS->TYPE="begin balance").AND.PAYEE"patti".AND.PAYEE"john".AND.PAYOR"elizabeth".AND.PAYOR"equitable".AND.PAYOR"edwin"".AND."(ACCOUNT_NUMBR="600663".AND.ACCTITEMS->TYPE="begin balance")"

    I need the query to include acct # 600663 where the TYPE = Begin Balance. How do I write this?

    Thanks,

    kenn
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    #2
    RE: Compound Query??

    ="(ACCOUNT_NUMBR="600655".AND.(ACCTITEMS->TYPE="deposit".OR.ACCTITEMS->TYPE="cashed".OR.ACCTITEMS->TYPE="begin balance").AND.PAYEE"patti".AND.PAYEE"john".AND.PAYOR"elizabeth".AND.PAYOR"equitable".AND.PAYOR"edwin").OR.(ACCOUNT_NUMBR="600663".AND.ACCTITEMS->TYPE="begin balance")"

    Just a guess.. put the first expresiion in parens with an .OR. for the second filter (in parens as well). Should evaluate each expression seperately. I didn't try to recreate your example, for obvious reasons!
    Mick

    Comment


      #3
      RE: Compound Query??

      Hey Mick,

      Been trying that only using .AND. I changed the .AND. to .OR. but met with the same result, Expected value. I'm wondering, what value is expected??

      This is my last try.

      query.filter =("ACCOUNT_NUMBR="600655".AND.(ACCTITEMS->TYPE="deposit".OR.ACCTITEMS->TYPE="cashed".OR.ACCTITEMS->TYPE="begin balance").AND.PAYEE"patti".AND.PAYEE"john".AND.PAYOR"elizabeth".AND.PAYOR"equitable".AND.PAYOR"edwin"").AND.("ACCOUNT_NUMBR="600663".AND.(ACCTITEMS->TYPE="begin balance"))

      I've used the Genie and it yields the same for for both accounts, not what I need.

      Thanks,

      kenn
      TYVM :) kenn

      Knowing what you can achieve will not become reality until you imagine and explore.

      Comment


        #4
        RE: Compound Query??

        Several problems. First, you have:

        .AND."(ACCOUNT_NUMBR="600663".AND.ACCTITEMS->TYPE="begin balance")"

        The AND should be an OR (the way you have it, ACCT_NO probably cannot equal both values - the OR will allow either).

        Also, you have quotes withing the query filter. I'm surprised the first part works, since they should be appostrophe's (sp??). i.e.,

        ACCOUNT_NUMBR='600663'

        Finally, lose the " just after the .OR.

        .OR.(ACCOUNT_NUMBR='600663'.AND.ACCTITEMS->TYPE='begin balance')"

        After you fix it, I don't know if the expression will exceed the max number of characters.

        good luck.

        Comment


          #5
          RE: Compound Query??

          Bill,

          I used the Query Genie to construct the first part of the query and copied the code form the Script recorder. The first part of the code works like a charm. Interestingly, this is based on a single table yet the genie included the table name in places which causes me to wonder why? It works just as well w/o the table name.

          I agree with your explanation of AND vs OR. I realized that while reviewing Mick's post. I will try ditching the " and change the "'s to ' and see what happens. The app is at work so won't be able to get at it till the am.

          I appreciate your suggestions. Thanks

          kenn
          TYVM :) kenn

          Knowing what you can achieve will not become reality until you imagine and explore.

          Comment


            #6
            RE: Compound Query??

            Bill,

            I tried you suggestions and no matter what combination I run, " vs' etc., I get the Expected Value message.

            I created 2 separate queries, one for each account # and both work.

            "ACCOUNT_NUMBR="600655".AND.(TYPE="Deposit".OR.TYPE="Cashed".OR.TYPE="Begin Balance").AND.(PAYEE"john".OR.PAYEE"patti").AND.(PAYOR"equitable".OR.PAYOR"elizabeth".OR.PAYOR"edwin")"

            The other:

            "ACCOUNT_NUMBR="600663".AND.TYPE="begin balance""

            I also exchanged the " for ' and got another Expected Value for the tbl.query_create() line.

            When I combine the two using () around each separated by .OR., the error messages go bonkers, Arguement is Incorect data type, first on one line of code; exit the form and return and then it's on another line of code.

            ("ACCOUNT_NUMBR="600655".AND.(TYPE="Deposit".OR.TYPE="Cashed".OR.TYPE="Begin Balance").AND.(PAYEE"john".OR.PAYEE"patti").AND.(PAYOR"equitable".OR.PAYOR"elizabeth".OR.PAYOR"edwin")").OR.("ACCOUNT_NUMBR="600663".AND.TYPE="begin balance"")

            Database compact doesn't help. I'm running out of brainstorm ways to do this. Surely, this isn't too big for A5's britches!

            kenn

            TYVM :) kenn

            Knowing what you can achieve will not become reality until you imagine and explore.

            Comment


              #7
              RE: Compound Query??

              This line of code works in a report:

              (ACCTITEMS->ACCOUNT_NUMBR="600655".OR.ACCTITEMS->ACCOUNT_NUMBR="600663").AND.(ACCTITEMS->TYPE="Deposit".OR.ACCTITEMS->TYPE="Begin Balance".OR.ACCTITEMS->TYPE="Cashed").AND.ACCTITEMS->PAYEE"patti".AND.ACCTITEMS->PAYEE"john"

              BUT, when placed in the query on a form, (on a button), the message tbl.query_create() Invalid Query Specified.

              Why does it work on the report but not the form?

              Thanks,

              kenn
              TYVM :) kenn

              Knowing what you can achieve will not become reality until you imagine and explore.

              Comment


                #8
                RE: Compound Query??

                If you'll remember from Tom's presentation at the conference, when you change from using a query expression in a report, etc to using the expression in xbasic,you have to allow for the

                query.filter = "filter string"

                fact that the whole filter string must be enclosed in quotes.

                Taking a quick look,I think you need to use

                query.filter = "(ACCTITEMS->ACCOUNT_NUMBR='600655'.OR.ACCTITEMS->ACCOUNT_NUMBR='600663').AND.(ACCTITEMS->TYPE='Deposit'.OR.ACCTITEMS->TYPE='Begin Balance'.OR.ACCTITEMS->TYPE='Cashed').AND.ACCTITEMS->PAYEE'patti'.AND.ACCTITEMS->PAYEE'john'"

                if you are hard-coding the text strings '600655', 'Cashed', etc.

                If you want to pass variables to this filter, that's another story.
                There can be only one.

                Comment


                  #9
                  RE: Compound Query??

                  Hi Stan,

                  I was in the other session but did catch the last 10-15 minutes of his class. Thanks for the info. I'll work on it tomorrow when I get to work.

                  kenn
                  TYVM :) kenn

                  Knowing what you can achieve will not become reality until you imagine and explore.

                  Comment

                  Working...
                  X