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

Query by Table

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

    Query by Table

    I would like to enter the following expression in a Query by Table and save it as an Operation:
    Bill_Date=?.OR.Bill_Date=MOD(?+6,12).AND.Time=M

    The ? should be a prompt for the user to enter a numeric (1-Jan, 2=Feb, etc.). The Time field is a character field that has a value of "Y" for yearly or "M" for every 6 months.

    I have entered Bill_Date under Field/Expression and the variable Ask_User under Condition and it does show me the correct records for the numeric entered for both Time=Y and Time=M which is what I want. My problem is getting the last part of the equation (.OR.Bill_Date=MOD(?+6,12).AND.Time=M)to work with it.

    My final product, if I enter the value 2, should show me all the records with 2 for Bill_Date and Y or M for Time and 8 for Bill_Date and M for Time.

    I hope this question doesn't give anyone an Excedrin headache! Thanks for your help!

    #2
    RE: Query by Table

    Arthur,

    I think you gave A5 a headache. You told it, give me the records (prompt) or give me ??. I think A5, after giving you the records which matched the prompt, didn't know what to do with the rest becasue A5 fulfilled your request with the 1st part of the expression. Perhaps you need to turn the expression around so that the if, then conditions were met first and then use the prompt to act as another filter.

    I'm not an expert at Xbasic yet but that's what I would try. There are others much better at this than I and I could be proved as wrong. We'll see.

    kenn
    TYVM :) kenn

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

    Comment


      #3
      RE: Query by Table

      Ken,

      A5 didn't give me the rest because I didn't put that part of the expression in yet. That's my question - how do I enter in the Query by Table. The expression works fine in Alpha4.

      Comment


        #4
        RE: Query by Table

        Let me work on it a bit.

        ken
        TYVM :) kenn

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

        Comment


          #5
          RE: Query by Table

          Is the last part of the expresssion:

          .AND.Time=M

          And everything works up to that point?

          ken
          TYVM :) kenn

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

          Comment


            #6
            RE: Query by Table

            Oh Duh! It's late and I'm tired. I see what is the last part of the expression.

            ken
            TYVM :) kenn

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

            Comment


              #7
              RE: Query by Table

              I guess I'm a bit confused. You say (.OR.Bill_Date=MOD(?+6,12).AND.Time=M) is the last part of the expression but then you say that part of the expression, Y & M, return the right records. (at least that's how I understand it).

              Break your expression down and show me/us what part is working.

              ken
              TYVM :) kenn

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

              Comment


                #8
                RE: Query by Table

                Ken

                For the prompt, I will use the numeric 2 for the month of February.

                Bill_Date=2 .OR. Bill_Date-MOD(2+6,12).AND.Time=M

                The first part (Bill_Date=2) shows me all the Feburary/Yearly invoices and all the February/6 Month invoices.

                The second part (.OR.Bill_Date=MOD(2+6,12).AND.Time=M) shows me all the August/6 Month ivoices.

                The idea of the second part is to find the invoices marked M for Time that are six months from the requested month. It works fine in A4. I just want to know how to correctly enter it in the Query By Table form so I can save it as an operation.

                I have entered the first part (Bill_Date=Ask User) in the Query By Table form and it works fine and prompts me for the numeric month. Unfortunately, it doesn't allow me to add the second part. I'm just wondering if I'm doing it wrong or the second part is something that can not be entered.

                Comment


                  #9
                  RE: Query by Table

                  Arthur,

                  Now I understand better. I'm not sure I'll have an answer for you but I do know that some (or even most) sctipts work differently in A5. Try doing a search, something like:

                  A4 and A5 and script

                  There has been a number of posts concerning the difference of code between the two. I tried the above and came up with 87 hits. I also tried (A4 and script) and came up with 107 hits. However, when I clicked on one, it took me to the message board screen where you can choose which post version of A5 to view. Tried this several times, all with the same results. I don't know if it's on my end or if something got crossed up.

                  Also, you might try this, use a solid date in the first part of your expression, don't use the var->ask. (It's not always reliable and this may be one of those times) Such as

                  Bill_Date=2 .OR. Bill_Date-MOD(2+6,12).AND.Time=M

                  Then add the second part and see what happens. Also, try leaving off the part beginning with .AND. It may give you some direction. See if you can get it to work in segments bwyond the 1st part.

                  However, I do think that viewing some of the previous posts will shed some light on your situation. Hopefully, someone with expertese will know more about this.

                  ken
                  TYVM :) kenn

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

                  Comment


                    #10
                    RE: Query by Table

                    Arthur,

                    Try this as well. I found it by reading a post by Ron Wills in discussing Access vs A5.

                    "Place your coursor at the beginning of the function and press F1. Alpha help files
                    provide the formula AND examples."

                    I learn a bunch by reading other posts that seem to have nothing to do with my problem.

                    ken
                    TYVM :) kenn

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

                    Comment


                      #11
                      RE: Query by Table

                      >

                      Whenever you use more than 1 boolean it's a good idea to use parenthesis to isolate the experessions that need to be considered separately, just to make sure that the expression get evaluated the way you think it is going to.

                      If the second data clause is only applicable under certain conditions of Time, try using:
                      Bill_Date=2 .OR. (Bill_Date=MOD(2+6,12).AND.Time=M)

                      Comment


                        #12
                        RE: Query by Table

                        Ken,

                        I appreciate your suggestions! Thanks!

                        Comment


                          #13
                          RE: Query by Table

                          Jim,

                          Thanks for your suggestion. It worked! I even have it prompting me for the month (numeric)as I wanted it to do. The only snag I had, after using your suggestion, was I had a problem with the Time (Time=M) stating "No Such Field". I resolved that problem by putting quotes around M (Time="M").

                          Thanks again! I'll have more question as I continue to develop the convertion..

                          Comment


                            #14
                            RE: Query by Table

                            Arthur,

                            You're most welcome. Glad I could be of some help.

                            Kenn
                            TYVM :) kenn

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

                            Comment

                            Working...
                            X