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

Only Same or Increment Data Updated

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

    Only Same or Increment Data Updated

    Is There anyway to run update records which first 2 letters shall be the same of previous or increment ex:
    record 12 (field 1)=John Field 2=[Jo]
    record 13 (field 1)=Joe Field 2=[ Left blank]

    record 14 (field 1)=Richard Field 2=[Ri]
    record 15 (field 1)=Richard Field 2=[ Ri]

    Thank You

    #2
    Re: Only Same or Increment Data Updated

    Your question and example are not understandable/decipherable to me to know what you are wanting.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    Comment


      #3
      Re: Only Same or Increment Data Updated

      We want to do a special type of sorting on the first 2 characters & only selected records
      we are attaching a sample sheet
      Attached Files

      Comment


        #4
        Re: Only Same or Increment Data Updated

        You can sort almost any way you can conceive.

        Given your first example where field1 holds the values John, Joe, Richard, and Richard it seems you want to sort by left(field1,2). Try that as the order expression for whatever layout you are building.
        There can be only one.

        Comment


          #5
          Re: Only Same or Increment Data Updated

          Somewhat right , but we want the in betweens also kept according to the present order so we would change the in between characters 2 left to the previous record

          Thank You

          Comment


            #6
            Re: Only Same or Increment Data Updated

            This sounds very similar to your previous request to fill a field, if blank, with the contents of the previous field. Now you only want to carry the first two characters forward?

            Code:
            tbl = table.open("your_table_name")
            tbl.order("recno()") tbl.fetch_first()
            while .not. tbl.fetch_eof()
            	prev_val = tbl.[COLOR="#FF0000"]field_to_copy[/COLOR] [COLOR="#FF0000"]'field_to_copy is the field you want to use if the next record is blank[/COLOR]	
                     tbl.fetch_next()
            	if alltrim(tbl.[COLOR="#FF0000"]field_to_copy[/COLOR]) = ""
            		tbl.change_begin()
            		tbl.field_to_copy = [COLOR="#FF0000"][B]left[/B]([/COLOR]prev_val,2[COLOR="#FF0000"][B])[/B][/COLOR]
            		tbl.change_end(.T.)
            	end if
            end while
            There can be only one.

            Comment


              #7
              Re: Only Same or Increment Data Updated

              The hard part is understanding. I think what lkatz1 wants (only from looking at the sample) is that for the following record;- if it has, in its right hand column, the same 2 left characters as the previous record's 2 characters in the left column, to repeat that in the left column. If there is a first 2 char name change, then make the left column blank. I just cant figure why.
              BUT according to the explanation in post 1, Joe follows John - the first two letters ARE the same but the name is different so the left column will be left blank.
              Go figure
              Last edited by Ray in Capetown; 07-27-2011, 08:42 AM. Reason: add BUT

              Comment


                #8
                Re: Only Same or Increment Data Updated

                There remains no definitive decipherable logic to what is and has been presented!

                Ray, Your explanation does not work
                If there is a first 2 char name change, then make the left column blank
                If this were true, the 4th entry follows 3 CO's is not CO and therefore the column would be blank. It is not.

                The only explanation I can speculate upon is what is wanted is this - if the left two characters to a name is the same as the immediate previous name, the left column is not blank, but is left(name,2). Otherwise if it is a different name with the first two letters being not the same as two left letters previously evaluated, then the left column is left(name,2). Otherwise if the first two letters are not the same as the prior records BUT they have been encountered previously, the left column is blank.

                That is the only pattern that the two examples that this person who hasn't given his/her name can be extrapolated to.
                Code:
                SORT_LETS	ALPHANAME
                Sm	Smith, John                                                 
                Fi	Finney, Jim                                                 
                Ko	Kooi, Janna                                                 
                Po	Porte, Jeff                                                 
                Za	Zahn, Richard                                               
                St	Stacey, Mark                                                
                Wi	Wilson, Mike                                                
                Wi	Wilson, Sue Q                                               
                  	Porte, Jared L                                              
                Jo	Johnson, Thurman K                                          
                La	Laski, Harold                                               
                Hu	Humbleton, Eric L                                           
                Mi	Miners, Kim H                                               
                Pa	Pandette, Justin D                                          
                  	Mienderos, Carlos H                                         
                  	Windsor, Bradley G                                          
                Sa	Sanders, Jeremy L                                           
                Ca	Cantana, Huleo J                                            
                Ba	Banderas, Carlos T                                          
                Tr	Trainer, Tom F                                              
                  	Laslie, Kevin D                                             
                Ju	Julius, Carmen L                                            
                Co	Cone, Tomas R                                               
                  	Winters, Hadley K                                           
                Ro	Robertson, K Elmo                                           
                Ra	Randers, Paul K                                             
                Fa	Fandlermar, Penny W                                         
                Re	Rench, Pentty H                                             
                  	Randolf, Gail A
                Attached Files
                Last edited by Mike Wilson; 07-27-2011, 12:13 PM.
                Mike W
                __________________________
                "I rebel in at least small things to express to the world that I have not completely surrendered"

                Comment


                  #9
                  Re: Only Same or Increment Data Updated

                  Yep, this is hilarious Mike.
                  My first paragraph is base on example record 13, second paragraph illustrates the contradiction
                  In the meantime no word from the initiator

                  BTW you neat code works, but on an assumption;- that he means anytime prev?
                  It does provide a practical intention. But then he would've used a sort, require much simpler code.

                  Comment


                    #10
                    Re: Only Same or Increment Data Updated

                    No Luck;
                    The following is our request,
                    We have Tousands of names some have last names (only when the lastname changes) the list is alphbatized according to the lastnames even when there is no lastname (because its the same lastname)in that field only a first name is going to appear, so we are trying to figure our & add lastnames to those who are missing there lastnames.We have complete sections from each letter indvidual ex: "A" all names start with Aa First then "Ab" ,"Ac" with no seprations or blank row

                    Thank You

                    Comment


                      #11
                      Re: Only Same or Increment Data Updated

                      Well, I for one remain without an understanding of what your situation is and what the rules are to generate a code that could transform your list into what you need.

                      Maybe if you gave us an example list of the names as they currently exist, and then what the list should be after the list has been transformed to what you would like it to be. And there needs to be many more than just 5-6 names.... maybe a couple of dozen, in order for an understanding to be achieved. Because what you have provided so far still remains undecipherable.
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #12
                        Re: Only Same or Increment Data Updated

                        The first file snapshot is how its now
                        We are in the alpehbetical letter "L" ascending

                        the second how it shall be finalized

                        Thank you Very much for patiance
                        Attached Files

                        Comment


                          #13
                          Re: Only Same or Increment Data Updated

                          And how exactly are you getting these to be sorted by a last name "L" if the name does not have the last name?
                          Mike W
                          __________________________
                          "I rebel in at least small things to express to the world that I have not completely surrendered"

                          Comment


                            #14
                            Re: Only Same or Increment Data Updated

                            I believe this cannot be done. There is an example of why in the last names on your example list. The name Leahy follows Leaencul. It cannot be determined whether 'Leahy' is a first name for the family name Leaencul and theferfor Leahy C Leaencul or whether Leahy is a new last name in the alphabetical sequence of last names. Also, what would L Constance Chris and....... be? That cannot be determined manually much less programatically.

                            Unless there is some other data factor to key up for the evaluation process, assigning a family name to each name cannot be done with this limited data.
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment


                              #15
                              Re: Only Same or Increment Data Updated

                              We can add w_count(name)=1 , but we still need to go by alphabetical sequence of last names at least will have determined that joe can not be a last name even when w-count=2 because its not alphabetical sequence of last names


                              2. These were entered by alphabetical sequence of last names whithout last names
                              Thank You

                              Comment

                              Working...
                              X