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

Filtering on a date - Please help ...

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

    Filtering on a date - Please help ...

    I have a dialog component with just 2 fields:

    PROV - a character field

    DATE - a date type field

    I have the following code in the AfterValidate event:

    filter="(Prov=quote({CurrentForm.Controls.Prov})).and.(Date=ctod(quote({CurrentForm.Controls.Date}))"

    CurrentForm.RedirectTarget="Scheduler.a5w?Scheduler_filter="+filter

    When I run this, I get an error message.

    Can anyone please help me with this. I have been struggling for hours and hours ...

    Gary
    Gary S. Traub, Ph.D.


    #2
    Re: Filtering on a date - Please help ...

    I guess my basic question is how to set up the filter with a date. The date field is called DATE.
    Gary S. Traub, Ph.D.

    Comment


      #3
      Re: Filtering on a date - Please help ...

      Alright Gary, I'll take a shot at it. Can't promise it's right without test data though:

      Code:
      filter = "Prov = '" + Currentform.Controls.Prov + "' .and. Date = " + ctod(CurrentForm.Controls.Date)
      -Steve
      sigpic

      Comment


        #4
        Re: Filtering on a date - Please help ...

        Steve,

        Thanks so much for responding. Here is the error message that results from your code:

        Error 4 - Invalid filter or order expression: Argument is incorrect data type
        Filter expression: (appt="Y") .and. (Prov = 'GT' .and. Date = 03/14/2008)
        Order expression: cdate(Date)+str(Timesort,19,5)+Fullname+svcode
        Gary S. Traub, Ph.D.

        Comment


          #5
          Re: Filtering on a date - Please help ...

          Now you've thrown in another piece: the Appt = "Y" and an order expression.

          If someone has the energy, I think they'll need a complete picture of what you have, maybe with a few sample records. Dunno if I can offer much more today but maybe someone else can.
          -Steve
          sigpic

          Comment


            #6
            Re: Filtering on a date - Please help ...

            Steve,

            The appt and order expression have nothing to do with the problem. Those are defined within the grid itself. As a matter of fact, it is the syntax regarding the date that is the problem, because removing date altogether eliminates all errors.

            However, I have figured out another way around the problem. I simply defined prov and date as session varaibles in the dialog component, then I created argument called arg_date and arg_prov and passed the session variables to those 2 arguments, and then based the filter in the grid on those 2 arguments. Works great!

            I hope that this is helpful to others.

            I still would like to know, for future reference, what the correct syntax would be in the sutuation as referred to above, if anyone cares to look at this.

            Thanks for your thoughts Steve ...

            Gary
            Gary S. Traub, Ph.D.

            Comment


              #7
              Re: Filtering on a date - Please help ...

              try
              Code:
              filter = "Prov = '" + Currentform.Controls.Prov + "' .and. Date = [COLOR=Red][B]{[/B][/COLOR]" + ctod(CurrentForm.Controls.Date)[B][COLOR=Red]+"}"
              
              [/COLOR][/B][COLOR=Red][COLOR=Black]or
              [/COLOR][/COLOR]
              filter = "Prov = '" + Currentform.Controls.Prov + "' .and. Date = " + [B][COLOR=Red]s_quote([/COLOR][/B]ctod(CurrentForm.Controls.Date)[COLOR=Red][B])[/B][/COLOR]
              Tim Kiebert
              Eagle Creek Citrus
              A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

              Comment


                #8
                Re: Filtering on a date - Please help ...

                Hi Tim,

                Thanks so much. Your code works!!

                I do have a question though, In your opinion, is there an advanyage of one method over the other, i.e., using arguments within the grid filter versus using variables within the dialog that get passed to the page via the url?

                Gary
                Gary S. Traub, Ph.D.

                Comment


                  #9
                  Re: Filtering on a date - Please help ...

                  Sorry Gary, That question is beyond me for now as I have not ventured in to the web end of the pool yet. The filter I can handle cause it's pretty much the same when you need to apply it against a table.

                  Maybe one of the Steves can chime back in on this one.
                  Tim Kiebert
                  Eagle Creek Citrus
                  A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                  Comment


                    #10
                    Re: Filtering on a date - Please help ...

                    Thanks Tim.
                    Gary S. Traub, Ph.D.

                    Comment


                      #11
                      Re: Filtering on a date - Please help ...

                      Dr. Gary,

                      I'm usually happy if I can figure out one way to do something, and you have two!

                      Siince both work, I'd make the selection based on what else I might want to do with the components...I try to reuse components when I can. The argument in the grid approach usually makes the grid a one-trick-pony, but it can be used in other pages.
                      The session variables in the dialog, on the other hand, can be tested for in the initialize event and the dialog used for additional purposes.

                      So, there isn't one best answer. It depends on your overall design.

                      Pat
                      Pat Bremkamp
                      MindKicks Consulting

                      Comment


                        #12
                        Re: Filtering on a date - Please help ...

                        Hi Pat,

                        Thanks for your thoughts. Based on what you said, it seems that the url approach is probably "better" in that there is more flexibility.

                        Thanks again for your input.

                        Gary
                        Gary S. Traub, Ph.D.

                        Comment

                        Working...
                        X