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

Could This Be a Leap Year Problem?

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

    Could This Be a Leap Year Problem?

    Hi All,

    Upon just uprading to V10.5 (from V5), a user notes that several records are missing from a report. I thought at first that this was simply one of the many ways that stricter syntax was required for later versions. But upon investigating, I found something which I cannot explain. It seemingly has to do with the between() function and/or the involvement of a leap year.

    There were four missing records for the report in question. From the code below, you will see that if I look for records with the Serv_start date between 1/1/2011 and 2/20/2013, I find four matching records. As shown, all four of these have Serv_start dates of 2/21/2012.

    But if I look for records with Serv_start dates between 1/1/2012 and 2/20/2013, it finds no records!!!


    Code:
    fltr = "medicaid='02 10 097352-01'.AND.between(serv_start,{01/01/2011},{02/20/2013})"
    
    ?fltr
    = "medicaid='02 10 097352-01'.AND.between(serv_start,{01/01/2011},{02/20/2013})"
    
    ?table.external_record_content_get("caregvn","dtoc(serv_start)","",fltr)
    = 02/21/2012
    02/21/2012
    02/21/2012
    02/21/2012
    
    ?a5_get_records_in_query("caregvn",fltr)
    = 4
    
    
    
    
    fltr = "medicaid='02 10 097352-01'.AND.between(serv_start,{01/01/2012},{02/20/2013})"
    
    ?fltr
    = "medicaid='02 10 097352-01'.AND.between(serv_start,{01/01/2012},{02/20/2013})"
    
    ?table.external_record_content_get("caregvn","dtoc(serv_start)","",fltr)
    = ""
    
    ?a5_get_records_in_query("caregvn",fltr)
    = 0
    I've heard of problems encountered on previous leap years but have found no conclusive postings thus far. Can any explain what I've encountered? Thanks.

    Steve

    #2
    Re: Could This Be a Leap Year Problem?

    Seems to work OK in v8.
    Have your tried between_date() instead?

    Comment


      #3
      Re: Could This Be a Leap Year Problem?

      Between_Date() doesn't return a logical value. Instead, it returns a character string of code (which encompasses the Between() function).

      I'm still perplexed on why date comparisons behave so incorrectly. I've even changed the Between() expression to one of the format: "Serv_st>={01/01/2012}.AND.Serv_start<={02/20/2013}". The problem still persists.

      Comment


        #4
        Re: Could This Be a Leap Year Problem?

        If I understand the issue, always in doubt, I don't see the problem testing solely on dates.

        Code:
        fltr = "between(dt,{01/01/2012},{02/20/2013})"
        
        ? table.external_record_content_get("anames","dtoc(dt)","",fltr)
        = 01/05/2012
        02/21/2012
        02/21/2012
        02/21/2012
        03/07/2012
        
        
        fltr = "between(dt,{01/01/2011},{02/20/2013})"
        
        ? table.external_record_content_get("anames","dtoc(dt)","",fltr)
        = 01/05/2012
        02/21/2012
        02/21/2012
        02/21/2012
        03/07/2012
        
        
        fltr = "between(dt,{02/01/2011},{02/29/2012})"
        ? table.external_record_content_get("anames","dtoc(dt)","",fltr)
        = 01/05/2012
        02/21/2012
        02/21/2012
        02/21/2012
        
        fltr = "between(dt,{02/01/2012},{02/29/2012})"
        ? table.external_record_content_get("anames","dtoc(dt)","",fltr)
        = 02/21/2012
        02/21/2012
        02/21/2012
        Same results in V8 and V10.
        Last edited by Stan Mathews; 02-23-2012, 10:43 AM.
        There can be only one.

        Comment


          #5
          Re: Could This Be a Leap Year Problem?

          Hi Steve

          Try a filter like this instead
          "(medicaid='02 10 097352-01').AND.between(cdate(serv_start),cdate({01/01/2011}),cdate({02/20/2013}))"

          Note the extra parenthesis in the 1st term. This guarantees the evaluation order. The cdate() functions puts the between comparing character text, not dates, so may work more reliably.

          One issue is that IF alpha is using LQO, and you have an index based on serv_start (at least at the beginning of an index expression) , the index that is being used for LQO could be corrupted. Try rebuilding it (or any using serv_start), and see if the problem goes away.

          As for it being a leap year issue, I seriously doubt it. There is no need for leap year value info in your comparisons, and thus Alpha would not be processing anything associated with it.

          See also my related date tips here

          As to the problem, wrap it up for Alpha, and send it along and maybe they can determine if there is a bug or not.
          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


            #6
            Re: Could This Be a Leap Year Problem?

            Steve:
            To narrow down the issue, I would:
            1-Try the filter with the date only,
            2-Try it with the string part only
            3-Then try it with the date before the string, i.e.:
            fltr = "between(serv_start,{01/01/2011},{02/20/2013}).AND.medicaid='02 10 097352-01'"
            4-If all fail, try to evaluate serv_start before declaring the filter

            Comment


              #7
              Re: Could This Be a Leap Year Problem?

              THANK YOU, Ira!!!
              ... and thanks to Gabe and Stan as well.

              I did change the between() to compare the CDATE() values of the dates instead and it finally worked.

              From this point on (especially until we get past 2/29/12), I will be very suspicious of date comparisons throughout my applications. I want to eventually find the cause of the problem but do not have time at the momnent to do so. Thanks again.

              Steve

              Comment


                #8
                Re: Could This Be a Leap Year Problem?

                Steve:
                For what's worth i just took another look at your code and noticed:
                Code:
                table.external_record_content_get("caregvn","dtoc(serv_start)","",fltr)
                Change that to:
                Code:
                table.external_record_content_get("caregvn","dtoc(serv_start)",[COLOR="#FF0000"][B]"serv_start"[/B][/COLOR],fltr)[COLOR="#FF0000"]'or any other field of your choice[/COLOR]
                and see what happens.

                Comment


                  #9
                  Re: Could This Be a Leap Year Problem?

                  Hi Steve:

                  I found a similar issue today when I tried to run statements for a my net 30 customers. The statement for one customer showed the orders but no aging and no totals. All other customers did calculate correctly. It took a few hours but I narrowed the problem down to orders with an invoice date of 11/29/2011.

                  I confirmed this issue by going back to this customer's previous orders and manually changing the amount due so they would be past due. I ran the statement and there were the old order records with the aging calculating correctly.

                  I should have stopped in here first, but as a long time user of A5, I'd never seen this issue before. I'll have to try the suggestions from Ira and see if this fixes my problem. Thanks for posting this issue.

                  I'm also using v 10.5.
                  Ed Merritt
                  UniversalWorkshop.com

                  Listen; there's a hell of a good universe next door: let's go.
                  e.e. cummings



                  Comment

                  Working...
                  X