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

Custom Query

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

    Custom Query

    I created a custom Query using action scripting: Query, Run Custom Query, Chose a single table, Checked the Prompt for Parameters at Runtime check box and entered 3 parameters; Lastname, Firstname and Address. Everything else is default. When I run the query by either last or first name, rather than finding the record, it sorts all records by record number. I've recreated this 3 times and each time with the same result. I tried to locate some way to bind the search parameter to the lastname and firstname fields but there is none. It just seems to me that this is the missing link and the reason why I cannot get it to work as it should.

    Ideas or suggestions please.
    TYVM :) kenn

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

    #2
    Re: Custom Query

    The Run Custom Query genie includes space for BOTH a filter expression and an ORDER expression. Sounds like you overlooked the ORDER expression in building your query.

    Comment


      #3
      Re: Custom Query

      Originally posted by Tom Cone Jr View Post
      The Run Custom Query genie includes space for BOTH a filter expression and an ORDER expression. Sounds like you overlooked the ORDER expression in building your query.
      I Tom,

      I'll try it again, but in one of my attempts, I did create an order using the 3 fields. Perhaps I should have wrapped in with Eval((). I'll give it a try.

      Nope! That didn't work. Does the same thing. I didn't find any documentation on this subject as well.
      Last edited by forskare; 03-03-2013, 05:06 PM.
      TYVM :) kenn

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

      Comment


        #4
        Re: Custom Query

        Ideas or suggestions please.
        Suggestion? Attach a sample table and support files which illustrate the issue.
        There can be only one.

        Comment


          #5
          Re: Custom Query

          Originally posted by Stan Mathews View Post
          Suggestion? Attach a sample table and support files which illustrate the issue.
          Wish I could. For some reason when I click upload, it goes to never, never land. This is the step by step

          On a form, I created a button using action scripting to call the query.

          I chose Query,
          Run Custom Query. The Script Genie Run Custom Query window pops open.
          Leave the Query Records in current form/Browse as is.
          Leave the Perform Query at which Level as is.
          Check the Prompt for Parameters at Runtime checkbx.
          Click Define Parameters
          Add a Parameter, I used Lastname for the Last name field, enter the Prompt and leave text box.
          Click OK.
          Leave the rest as default.

          As you will see, there is no way to select binding so anything that's done is done in the clouds. When the button is clicked, you will be prompted to enter a last name. Then click OK. Nothing is done except to reorder the records. Without binding, there is no way it will work.
          TYVM :) kenn

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

          Comment


            #6
            Re: Custom Query

            Kenn

            Email the sample to me...
            Al Buchholz
            Bookwood Systems, LTD
            Weekly QReportBuilder Webinars Thursday 1 pm CST

            Occam's Razor - KISS
            Normalize till it hurts - De-normalize till it works.
            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
            When we triage a problem it is much easier to read sample systems than to read a mind.
            "Make it as simple as possible, but not simpler."
            Albert Einstein

            http://www.iadn.com/images/media/iadn_member.png

            Comment


              #7
              Re: Custom Query

              Without binding, there is no way it will work.
              Precisely.

              entered 3 parameters; Lastname, Firstname and Address.
              Having done that, write the filter for the query using those as if they were variables.

              lastname = var->lastname .and. firstname = var->firstname .and. address = var->address

              The Run Custom Query action queries records based on custom filter and order expressions. This query can include parameters prompted for at run-time. If you choose to prompt for parameters at run-time, you can customize the prompts, title, and buttons on the parameters dialog.

              Procedure
              1.
              Make a selection in the Query records in which Form/Browse window? field. This field will be grayed out unless this action is based on a Form or Browse. The choices are:


              "Current Form or Browse Window".


              "Another Form or Browse Window".

              2.
              If you selected "Another Form or Browse Window", in the Window Name field select either:


              "Forms"


              "Browses"

              3.
              Select one of the listed forms or browses.

              4.
              Optionally, check Prompt for Parameters at run-time? to display the Define Parameters button. The resulting <span class=Screen>Define Parameters</span> dialog box lets you define the parameters that the user will be prompted for. When you add parameters, you are creating a dialog box to collect variables from the user at run-time. Once you have created the parameters for the query, you will then create an expression using the parameters on which the query will be based.

              5.
              Optionally, enter a character filter expression that selects records from the table in the Filter Expression field, or click the button to open the <span class=Screen>Filter Builder</span>.

              6.
              Optionally, enter an character order expression that sorts the number of records returned in the Order Expression field, or click the button to open the <span class=Screen>Order Builder</span>.

              7.
              Click the Query Options tab.

              8.
              Optionally, check the Combine filter with existing filter (if any) check box.

              9.
              Optionally, check the Exclude records selected by filter check box.

              10.
              Optionally, click the Tips on Parameters tab.

              11.
              Click Next >.

              12.
              Optionally modify the comment that describes the action.

              13.
              Click Finish.
              There can be only one.

              Comment


                #8
                Re: Custom Query

                I sent it to your support email.
                TYVM :) kenn

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

                Comment


                  #9
                  Re: Custom Query

                  Hi Stan,


                  I tried the filter several ways, as is, without the parameter names, and both ways wrapped with Eval(). I also included a sort order but that should have no effect on it. Anyhow, each time I got an Invalid filter or sort order every time.

                  I know I'm not the only one that can no longer upload files but maybe that will get fixed someday.

                  Thanks,
                  TYVM :) kenn

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

                  Comment


                    #10
                    Re: Custom Query

                    Originally posted by forskare View Post
                    I sent it to your support email.
                    Kenn

                    Check your email...
                    Al Buchholz
                    Bookwood Systems, LTD
                    Weekly QReportBuilder Webinars Thursday 1 pm CST

                    Occam's Razor - KISS
                    Normalize till it hurts - De-normalize till it works.
                    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                    When we triage a problem it is much easier to read sample systems than to read a mind.
                    "Make it as simple as possible, but not simpler."
                    Albert Einstein

                    http://www.iadn.com/images/media/iadn_member.png

                    Comment


                      #11
                      Re: Custom Query

                      Inquiring minds want to know how this turns out. Don't forget us!

                      Comment


                        #12
                        Re: Custom Query

                        Nope.

                        Part of the problem with Stan's suggestion was that I inadvertently added a space between last name and Alpha created the variable as Last_Name. Once I changed than it 'almost worked. I didn't ge any error messages but the query did not work. Instead, it found nothing and showed an empty browse instead of 8 records with the last name of Smith. I did more research and tried this filter:

                        (lastname = var->lastname) .and. (firstname = var->firstname) .and. (address = var->address)

                        It produced the same results, filtering out all the records. So, it's closer but still, no cigar.

                        The reason it filtered out all the records was because of the .and. which meant a value had to entered into all three text boxes. I changed the .and. to .or. but this simply reorders the browse.
                        Last edited by forskare; 03-03-2013, 07:58 PM.
                        TYVM :) kenn

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

                        Comment


                          #13
                          Re: Custom Query

                          Originally posted by Al Buchholz View Post
                          Kenn

                          Check your email...
                          Al,

                          Should be in your inbox.
                          TYVM :) kenn

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

                          Comment


                            #14
                            Re: Custom Query

                            This is what I put together for a sample from what Kenn sent me.

                            sample1.zip
                            Al Buchholz
                            Bookwood Systems, LTD
                            Weekly QReportBuilder Webinars Thursday 1 pm CST

                            Occam's Razor - KISS
                            Normalize till it hurts - De-normalize till it works.
                            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                            When we triage a problem it is much easier to read sample systems than to read a mind.
                            "Make it as simple as possible, but not simpler."
                            Albert Einstein

                            http://www.iadn.com/images/media/iadn_member.png

                            Comment


                              #15
                              Re: Custom Query

                              I opened the file and gave it a ride but it does nothing. I see there isn't anything in the filter so I used the genie to include the followint:

                              (( Var->Lastname $ lastname ) ) .or. (( Var->Firstname $ firstname ) ) .or. (( Var->Address $ bill_addr ) )

                              This simply resorts the filter.

                              Next, I changed the expression to:

                              Var->Lastname $ lastname

                              This found all records containing the characters I entered into the textbox, "smith".

                              Next, I tried:

                              Var->Firstname $ firstname but that didn't work. Why, I'm not sure but I'll work with it some more and see what gives.

                              This raised the question, How is this custom query supposed to work? The custom genie allows for any number of conditions to be set. In this case, I created 3, Lastname, Firstname and Address. The goal is to allow the user to search only by Lastname, First name, address or any combination. The question is, Will Alpha allow this or if there is more than one condition, will it require all conditions to be met?

                              +++++++++++++++++++++++++++++

                              I created a Custom query for each of the three conditions and it worked as advertised. However, it will only work with one field at a time. More than one condition can be set for each field but only one field can be used per query. (This is a bit redundant but I want to be clear) If you want to have one button open a custom query with more than one field to search, individually or together, it will not work. This is the filter as defined by the genie. I set the Lastname and Firstname to 'Begins with' and the address as 'Contains'. ( Var->Lastname $ lastname ) ) .or. (( Var->Firstname $ firstname ) ) .or. (( Var->Address $ bill_addr )) My testing showed the first part of the query would work on the last name part but not the Firstname or Address part. Those two merely resorted the browse. Perhaps someone might be able to rewrite the filter so that it can work with just one button.

                              Summary:

                              This is the basic idea I have in mind for which I started the other post about a much needed search for the desktop which doesn't need any code to create. Ideally, it would match the search part of a grid.
                              Last edited by forskare; 03-03-2013, 11:03 PM. Reason: Results of the Query
                              TYVM :) kenn

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

                              Comment

                              Working...
                              X