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

Case Select vs. Case()

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

    #16
    Re: Case Select vs. Case()

    Originally posted by gschepp View Post
    The first 3 digits indicate the issuing state.
    Just getting back to this briefly. So many entries, maybe this was mentioned already.

    Gary, I was hoping you could save me some time in researching which state has which number.

    Comment


      #17
      Re: Case Select vs. Case()

      Originally posted by G Gabriel View Post
      Just getting back to this briefly. So many entries, maybe this was mentioned already.

      Gary, I was hoping you could save me some time in researching which state has which number.
      In post number 8 above Gary lists all his case statements that link a range of numbers to a state. Not the source of his info but might give you what you need.
      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


        #18
        Re: Case Select vs. Case()

        Thanks. I will get to this later after end of business day.

        Comment


          #19
          Re: Case Select vs. Case()

          Originally posted by gschepp View Post
          I'm not sure there is a better way to accomplish it other than using the case select method in this instance.
          Yes there is. Several.
          Just had a chance to read few of the earlier posts and see what SSN is made up of.

          For a starter, your own function could be seriously simplified.
          Furthermore, alpha has a little known function that will make it even easier.
          But best of all, your thread couldn't be more timely as I am working on a better function for a scenario like yours but unfortunately I am stuck on what appears to be a bug in some of alpha's functions. I am pretty sure they are bugs but relectuant to call them so without more testing which needs time which I don't have. So for now, let's just simplify your function:
          Here is a simplified version of your function (please complete the rest of the states. You get the idea):
          Code:
          FUNCTION ssn AS C (ssn AS C )
          	if len(remspecial(ssn))<>9
          		msgbox("Invalid SSN")
          		else
          	x=val(ssn)
          	ssn=case(x<4,"NH",x<8,"ME",x<10,"VT")
          	end if
          END FUNCTION
          Code:
          dim ssn as c
          ssn="090-00-000"
          ?ssn(ssn)
          'this gave an "Invalid SSN" msg
          ssn="009-00-0000"
          ?ssn(ssn)
          = "VT"
          I will get to the other options later when I have more time, but a quick comment: from whatever little I read about SSN, a valid one cannot have more than one zero in a componenet or something along these lines. So, further validation might be required besides testing for the 9 digits entry.

          How is the component for the year is designed? If you post that, and following the same above pattern you could have a more comprehensive function.
          Last edited by G Gabriel; 12-29-2008, 03:17 PM.

          Comment


            #20
            Re: Case Select vs. Case()

            Originally posted by G Gabriel View Post
            I will get to the other options later when I have more time, but a quick comment: from whatever little I read about SSN, a valid one cannot have more than one zero in a componenet or something along these lines. So, further validation might be required besides testing for the 9 digits entry.

            How is the component for the year is designed? If you post that, and following the same above pattern you could have a more comprehensive function.
            As far as I know more than one zero does not create an invalid SSN. The area consisting of the first group of numbers starts with 001. The group consisting of the second group of numbers can be 01 thru 99.

            A SSN would be invalid if any of the 3 groups consists of all zeroes. If the first group number is greater than 770 it is invalid.


            As for the year, I have been unable to find any data that provides the basis to determine when a SSN was issued. The SSA does provide data for recent time period but nothing more than just a few years.

            Comment


              #21
              Re: Case Select vs. Case()

              Fun thread.

              I thought of a few ways. I can't perceive too much difference between methods.
              Last edited by Mike Wilson; 12-29-2008, 07:38 PM.
              Mike W
              __________________________
              "I rebel in at least small things to express to the world that I have not completely surrendered"

              Comment


                #22
                Re: Case Select vs. Case()

                Here is the full monty for the previously posted function:
                Code:
                FUNCTION SSN AS C (ssn AS C )
                	if len(remspecial(ssn))<>9
                		msgbox("Invalid SSN")
                		else
                	x=val(ssn)
                	SSN=case(x<4,"NH",x<8,"ME",x<10,"VT",x<35,"MA",x<40,"RI",x<50,"CT",x<135,"NY",x<159,"NJ",x<212,"PA",x<221,"MD",x<223,"DE",x<232,"VA",x<237,"WV",x<247,"NC",x<252,"SC",x<261,"GA",x<268,"FL",x<303,"OH",x<318,"IN",x<362,"IL",x<387,"MI",x<400,"WI",x<408,"KY",x<416,"TN",x<425,"AL",x<429,"MS",x<433,"AR",x<440,"LA",x<449,"OK",x<468,"TX",x<478,"MN",x<486,"IA",x<501,"MO",x<503,"ND",x<505,"SD",x<505,"NE",x<516,"KS",x<518,"MT",x<520,"ID",x<521,"WY",x<525,"CO",x<526,"NM",x<528,"AZ",x<530,"UT",x<531,"NV",x<540,"WA",x<545,"OR",x<574,"CA",x<575,"AK",x<577,"HI",x<580,"DC",x<581,"VI",x<585,"PR",x<586,"NM",x<587,"PI",x<589,"MS",x<596,"FL",x<600,"PR",x<602,"AZ",x<627,"CA",x<646,"TX",x<648,"UT",x<650,"NM")
                	end if
                END FUNCTION

                Comment


                  #23
                  Re: Case Select vs. Case()

                  Different take.. and in the overall I would think it would be faster:
                  Code:
                  FUNCTION SSN_St AS C (ssn AS C )
                  	if len(remspecial(ssn))<>9
                  		msgbox("Invalid SSN")
                  		else
                  	s=left(ssn,3)
                  	lst="4,NH,8,ME,10,VT,35,MA,40,RI,50,CT,135,NY,159,NJ,212,PA,221,MD,223,DE,232,VA,237,WV,247,NC,252,SC,261,GA,268,FL,303,OH,318,IN,362,IL,387,MI,400,WI,408,KY,416,TN,425,AL,429,MS,433,AR,440,LA,449,OK,468,TX,478,MN,486,IA,501,MO,503,ND,505,SD,505,NE,516,KS,518,MT,520,ID,521,WY,525,CO,526,NM,528,AZ,530,UT,531,NV,540,WA,545,OR,574,CA,575,AK,577,HI,580,DC,581,VI,585,PR,586,NM,587,PI,589,MS,596,FL,600,PR,602,AZ,627,CA,646,TX,648,UT,650,NM"
                  	dim x as n
                  	x=wordat(alltrim(s),lst,",")
                  	while x=0
                  		s=increment_value(s)
                  		x=wordat(alltrim(s),lst,",")
                  	end while
                  	SSN_St=word(lst,x+1)
                  	end if
                  END FUNCTION

                  Comment


                    #24
                    Re: Case Select vs. Case()

                    Here is an interesting link about SSN assignments.
                    http://stevemorse.org/ssn/ssn.html

                    The one thing it pointed out was that prefix 232 could be either West Virginia or N Carolina, depending on what the next 2 digits are.

                    Maybe that is worth looking into.

                    mike
                    Mike Reed
                    Phoenix, AZ

                    Comment


                      #25
                      Re: Case Select vs. Case()

                      Posting while talking to people on the phone is not a good idea. The lst in my last post is incorrect. Replace with:
                      Code:
                      "3,NH,7,ME,9,VT,34,MA,41,RI,49,CT,134,NY,158,NJ,211,PA,220,MD,222,DE,231,VA,236,WV,246,NC,251,SC,260,GA,267,FL,302,OH,317,IN,361,IL,386,MI,399,WI,407,KY,415,TN,424,AL,428,MS,432,AR,439,LA,448,OK,467,TX,477,MN,485,IA,500,MO,502,ND,504,SD,508,NE,515,KS,517,MT,519,ID,520,WY,524,CO,525,NM,527,AZ,529,UT,530,NV,539,WA,545,OR,573,CA,574,AK,576,HI,579,DC,580,VI,584,PR,585,NM,586,PI,588,MS,595,FL,599,PR,601,AZ,626,CA,645,TX,647,UT,649,NM"
                      Mike:
                      I looked at that link. The only thing you could deduct from that is after 1999 they added more prefixs to some states evidently the ones that exhuasted their numbers but it does not tell you what year the SSN was issued. You could only say if it was issued before 1999 or after.
                      Last edited by G Gabriel; 12-30-2008, 10:27 PM.

                      Comment

                      Working...
                      X