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

isblank() in post

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

  • isblank() in post

    I am trying to post a salesperson's ID from a customer table to the salesID in an order table.

    For the purpose of this question, I will name the tables customer and orders, with orders being the master table and customers being the transaction table.

    I have two possiblities for the salesID to be posted.
    1. the orders->pickup_date is between customer->from_date and customer->until_date.

    2. the order->pickup_date >= customer->from_date and customer->until_date is blank.

    The problem I am having is isblank(@customer->until_date) and isblank("@customer->untildate") both end up as an invalid or incomplete expression.

    Does someone know the trick to getting isblank() to work on a transaction table date field ?

    Thanks much,

    Gregg
    Gregg
    https://paiza.io is a great site to test and share sql code

  • #2
    Re: isblank() in post

    Doesn't appear to want to cooperate. You could use

    alltrim(cdate(@customer->untildate)) = ""
    There can be only one.

    Comment


    • #3
      Re: isblank() in post

      Thank you Stan.
      That seems to have done the trick.
      Gregg
      https://paiza.io is a great site to test and share sql code

      Comment


      • #4
        Re: isblank() in post

        Just as an additional method......

        I frequently use the following on date field processing:

        Customer->untildate={ / / }

        The above has 2 spaces between the slashes and 4 spaces after the last slash.

        I also have had problems using isblank (not just date fields)

        My foolproof code on character fields is:

        len(alltrim(Field1))=0

        Regards,

        Jeff

        Comment


        • #5
          Re: isblank() in post

          Code:
          Customer->untildate={ / / }
          If you hate typing, as I much as I do, you could simply use:
          Code:
          Customer->untildate={}

          Comment


          • #6
            Re: isblank() in post

            Hi Jeff,

            Originally posted by jkletrovets View Post
            I frequently use the following on date field processing:

            Customer->untildate={ / / }

            The above has 2 spaces between the slashes and 4 spaces after the last slash.

            I also have had problems using isblank (not just date fields)

            My foolproof code on character fields is:

            len(alltrim(Field1))=0
            For reasons that I was never able to ascertain, sometimes Alpha has effectively a { / / } as a blank date, and sometimes { } as a blank date. They should be identical, but in a few cases, they did not equate. So I always used for a comparison (similar to Stan's, but a very little bit faster by using TRIM() ),
            trim(cdate(@customer->untildate))==""
            which always worked. For character fields, I always use this comparison
            trim(charactervalueorField)==""
            which, by eliminating the len() function and using trim() instead of alltrim() should also be a tiny bit faster, but I haven't run extensive tests, and will probably be almost immeasurable in speed improvement.
            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


            • #7
              Re: isblank() in post

              For reasons that I was never able to ascertain, sometimes Alpha has effectively a { / / } as a blank date, and sometimes { } as a blank date. They should be identical, but in a few cases, they did not equate. So I always used for a comparison (similar to Stan's, but a very little bit faster by using TRIM() ),
              trim(cdate(@customer->untildate))==""

              which always worked. For character fields, I always use this comparison
              trim(charactervalueorField)==""

              which, by eliminating the len() function and using trim() instead of alltrim() should also be a tiny bit faster, but I haven't run extensive tests, and will probably be almost immeasurable in speed improvement.
              Hey Ira...thanks for the further viewpoint. My using { / / } is a holdover from my Fox 2.6 days (once I figured out IsBlank is not always reliable in Alpha).

              From your examples, why do you use "=="? Once again, from my Fox days....I just convert that to "Absolutley Equals" in my mind....I was curious what your reasons are for using that instead of just the "="?

              BTW, on a whole differenct subject...you have definitely turned me into a UDF fanatic. Just wanted to say thanks for your prominent viewpoint on that here on the message board......the benefits are many.....as you well know. :)

              Regards,

              Jeff

              Comment


              • #8
                Re: isblank() in post

                Hi Jeff,

                Originally posted by jkletrovets View Post
                From your examples, why do you use "=="? Once again, from my Fox days....I just convert that to "Absolutley Equals" in my mind....I was curious what your reasons are for using that instead of just the "="?
                The double equals (which I read as "is exactly equals" - PO-TAY-TOES, PO-TAH-TOES :D ) is because a single equals is not case-sensitive and implicitly trims the left and right parameters of the equals comparisons.

                In some cases this is OK if you are aware of the conversions and accept them, however, I like my code to be 100% definitive in it's meaning (to me and others) and never unintentionally have another meaning.

                So
                ?IF("ABC"="abc ",.t.,.f.)
                = .T.
                ?IF(("ABC"+" ")="abc ",.t.,.f.)
                = .T.
                varvalue=" "
                ?IF(("ABC"+varvalue)="abc ",.t.,.f.)
                = .T.
                varvalue="C "
                ?IF(("AB"+varvalue)="abc",.t.,.f.)
                = .T.
                Notice that the varvalue will have unknown quantities in it (sources can be user input, external data etc), and in most cases I want an exact match, even if it has trailing spaces.

                So in most cases I will use == as a definitive comparison (which only really applies to character values). If I want case insensitive, I'll put UPPER("aBc")=UPPER("abc"). If I want to trim 1 or both sides, I'll do that. It also makes it easier to find comparisons vs assignments when searching.

                Also, I always use extra parenthesis around pairs of objects, to make sure Alpha's expression evaluator does not get confused about the order of operation (I've seen that on very rare occasions in some versions/patches of A5 that got it wrong), and also, Alpha evaluates expression from the right side, e.g.
                logicvalue1 .or. logicvalue2 .and. logicvalue3
                Alpha will evaluate it like this
                logicvalue1 .or. (logicvalue2 .and. logicvalue3)
                which is way different than what might have been intended, as in
                (logicvalue1 .or. logicvalue2) .and. logicvalue3
                With extra parenthesis, there is no question. In the interactive window
                ?.t. .or. .f. .and. .f.
                = .T.
                ?.t. .or. .t. .and. .f.
                = .T.

                ?(.t. .or. .f.) .and. .f.
                = .F.
                ?(.t. .or. .t.) .and. .f.
                = .F.
                One more thing, is I will typically use .not.(value1==value2) as opposed to value1!=value2, as earlier versions of A5 did not support it, and my code is made to be fairly version independent, plus there were possibly bugs in the != operator in early versions of it I may have run into, so I stayed with the most reliable choice, although that may be overkill.
                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

                Working...
                X