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

Dates!

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

    Dates!

    Why won't my Date filters work now?
    I had(have) them set up using field Payback_Due>=date1 (which is of course a variable), etc... (ie+

    #2
    RE: Dates!

    How about posting the specifics?

    Comment


      #3
      RE: Dates!

      given that the variables are dates!
      otherwise
      variable1=ctod(ui_get_date("Enter beginning date",""))
      variable2=ctod(ui_get_date("Enter ending date",""))

      date1 is a valid field in the file
      query.filter="between(date1,variable1,variable2)"
      idx=file1.query_create()
      recs=idx.records_get()
      if recs
      Cole Custom Programming - Terrell, Texas
      972 524 8714
      [email protected]

      ____________________
      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

      Comment


        #4
        RE: Dates!

        I'm talking about a filter in a report I have used for some time...
        Payback_Due is a date field
        Date1 is a variable, as is Date2...
        Filter gets records where Payback_Due is greater (or equal) to Date1 and less (or equal) to Date2...
        Pretty simple, however...
        When I enter and load the variable dates with 01/15/2001 for Date1 and 01/20/2001 for Date2, report runs wild! I have to cancel or escape the "view" or build because it runs into THOSANDS of pages! (I stopped on at 1,900+ pages!)
        SHOULD be 4 or 5 max!
        Now the thing that driving me NUTTZ! is it works perfectly using 12/1/2000 to 12/31/2000 or any other dates in 2000!
        What have I created here a Y2K+1 nightmare?

        Any ideas on this seemingly SIMPLE problem would be appreciated.

        PS the code has worked for MONTHS in 2000. It's NOT my script!

        Comment


          #5
          RE: Dates!

          What version of alpha five are you using?

          also - are you using 4 places to specify year - or two places
          (you can use two places if you set the 21st century date
          window to be bigger than the dates that will be entered in your
          application -- it may be you simply need to make the date window bigger
          which will cause 2 digit year wrap around to occur later-
          this can be changed in viewsettings).

          example of year wrap-around:

          if date-window was set to 1:
          ? {1/1/0}
          = {01/01/2000}

          ? {1/1/1}
          = {01/01/1901}

          if date window was set to 20

          ? {1/1/0}
          = {01/01/2000}

          ? {1/1/1}
          = {01/01/2001}

          ? {1/1/19}
          = {01/01/2019}

          ? {1/1/20}
          = {01/01/1920}




          I tested the alpha five 4.03 build from the interactive window, and
          it appears to be handling dates in 2001 without a problem.

          dt1 = {01/15/2001}
          dt2 = {01/21/2001}
          dt = {01/16/2001}
          ? dt1

          Comment


            #6
            RE: Dates!

            John, I didn't mean to imply that there's a problem with your script, it's just that there are several different ways the filter expression might have been constructed. By letting us see the actual filter expression you are using we have a better shot at suggesting a specific solution.


            -- tom

            Comment


              #7
              RE: Dates!

              It 4.03, and I had the dates set to 20...
              (I've been using filters like this since the old DOS version(s) on my old 386, so it's NOT the variables or fields)
              I'll try demand for 4 digit years and see if that helps, I guess.
              Sumptin wiiieerd goin on here..
              I'm using windows98, but THAT shouldn't matter.
              What I just don't get is WHAT is it doing, and WHY does it work with 2000 dates?
              THANKS all for your feedback...
              I'm STUMPED!

              Comment


                #8
                RE: Dates!

                I understand... (I was just trying to NOT clutter up what SHOULD be a straight foreward thing)
                HERE'S the actual filter expression:
                Write_Off={}.and.Payback_Due>=Var->Date1.and.Payback_DueDate2.or.Int_Pd1.t..and.Int_Date1{}.and.Int_Date1>=Var->Date1.and.Int_Date1Date2.or.Int_Pd2.t..and.Int_Date2{}.and.Int_Date2>=Var->Date1.and.Int_Date2Date2.or.Int_Pd3.t..and.Int_Date3{}.and.Int_Date3>=Var->Date1.and.Int_Date3Date2

                Comment


                  #9
                  RE: Dates!

                  This is better! :-)
                  Write_Off={}.and.Payback_Due>=Var->Date1.and.Payback_DueDate2.or.Int_Pd1
                  .t..and.Int_Date1{}.and.Int_Date1>=Var->Date1.and.Int_Date1Date2.or.
                  Int_Pd2.t..and.Int_Date2{}.and.Int_Date2>=Var->Date1.and.Int_Date2Date2
                  .or.Int_Pd3.t..and.Int_Date3{}.and.Int_Date3>=Var->Date1.and.Int_Date3Date2

                  Comment


                    #10
                    RE: Dates!

                    I'm using 4.03 build 230...
                    Is THAT what you "tested"?

                    Comment


                      #11
                      RE: Dates!

                      I'll probably wish I had stayed out of this one but it seems to me that you should be using something like:

                      Write_Off={}.and.((Payback_Due>=Var->Date1.and.Payback_DueDate2).or.(Int_Pd1
                      .t..and.Int_Date1{}.and.Int_Date1>=Var->Date1.and.Int_Date1Date2).or.(Int_Pd2.t..and.Int_Date2{}.and.Int_Date2>=Var->Date1.and.Int_Date2Date2)
                      .or.(Int_Pd3.t..and.Int_Date3{}.and.Int_Date3>=Var->Date1.and.Int_Date3Date2))

                      This doesn't explain why you are having problems with 2001 dates, but then I don't know what all your dates represent and the data in the fields.
                      There can be only one.

                      Comment


                        #12
                        RE: Dates!

                        John, I was surprised at the absence of parentheses in your expression, and see that Stan had the same reaction by suggesting that it be rewritten slightly to include them. The User's Guide (at pg 216) recommends using parentheses to control the order in which logical operators (.and., .not., .or.) are used in an expression.


                        As noted, this does not explain why your expression worked during CY2000, and fails now, but I think it's a step in the right direction. My guess is that you have other values in the table (or perhaps values are missing) right at the beginning of the year, and this is causing the expression to evaluate differently without parentheses than it did laast year.


                        Good luck.


                        -- tom

                        Comment


                          #13
                          RE: Dates!

                          Yes - its build 230, Is there any way I could get my hands
                          on the application with some sample data so I can see if
                          I can reproduce the problem on my end?

                          Comment


                            #14
                            RE: Dates!

                            Hi John

                            I would try something like this;

                            (remspecial(dtoc(Write_Off))=="".and.Payback_Due>=Var->Date1.and.Payback_DueDate2)
                            .or.
                            (Int_Pd1=.f..and.remspecial(dtoc(Int_Date1))=="".and.Int_Date1>=Var->Date1.and.Int_Date1Date2)
                            .or.
                            (Int_Pd2=.f..and.remspecial(dtoc(Int_Date2))=="".and.Int_Date2>=Var->Date1.and.Int_Date2Date2)
                            .or.
                            (Int_Pd3=.f..and.remspecial(dtoc(Int_Date3))=="".and.Int_Date3>=Var->Date1.and.Int_Date3Date2)


                            The main differences are;

                            The test for a blank date is done in a more reliable way(for some reason A5 returns a blank date as { / / } as opposed to {}. This method of checking for a blank date works for all cases.

                            The parenthesis around the and portions of the equations. Alpha 5 (as opposed to A4) seems to considers And and Or at the same level of evaluation, which means the expression is definitely evaluated wrong without the parenthesis

                            I compared Int_Pdx=.f. as opposed to Int_Pdx.t. because it is a more straightforward, but would work either way.

                            Finally, if you get this to work, change the date comparisons to Between statements which are more efficient

                            Regards,

                            Ira J. Perlow
                            Computer Systems Design & Associates
                            [email protected]
                            Regards,

                            Ira J. Perlow
                            Computer Systems Design


                            CSDA A5 Products
                            New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                            CSDA Barcode Functions

                            CSDA Code Utility
                            CSDA Screen Capture


                            Comment


                              #15
                              RE: Dates!


                              If you try a "hard coded" expression (i.e. refering to a date constant, rather than a date variable), does it work?

                              for example:
                              payback_due >= {01/15/01}

                              if it does work, then you could try this as your expression:

                              payback_due >= "{"+dtoc(date1)+"}"


                              (this is equivalent to an expression with a "hard coded" date. e.g.

                              Comment

                              Working...
                              X