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

Alpha Holidays

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

    Alpha Holidays

    One more post for today. :)

    I am currently working on the specs for an app that will need to calculate number of working days and I have setup the holidays as I recommended under View Settings.

    Do the Bus_Days_Between() and rela�ed functions make note of a year change or do I have to manually set the holidays at the beginning of the year or write a script that automatically changes the year the first time the app runs in a new year?

    #2
    Re: Alpha Holidays

    Hi Glen,
    I would be interested as well as to what this setting actually does---by the looks of it, you would have to manually enter in the actual dates of any special holiday without having the ability to say choose...the 2nd Tuesday of April for a holiday that occurs in this way every year. This apparently would have to be done for holidays each year as an entire date including year seems to be required.......all just guesses now and await those who have played with this actually.

    Makes the setting a bit manual really and I personally would create my own script to account for these. If this Holiday list is written to the registry (most likely) then it can be modified as well using xbasic.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: Alpha Holidays

      If this Holiday list is written to the registry (most likely) then it can be modified as well using xbasic.
      A_holiday.dbf in the exe directory unless otherwise specified.

      Docs for add_bus_days().

      Holiday_Table
      Optional. Default = "a_holidays.dbf". If Ignore_Holiday_Flag is "yes", the function uses the list of holidays is supplied in Holiday_Table. If Holiday_Table is blank, then Alpha Five uses the "a_holidays.dbf" table which is contained in the Alpha Five program folder. The holidays in the "a_holidays.dbf" table are defined in the Settings dialog box, accessed with the View > Settings > System > Holidays command from the Alpha Five menus.
      There can be only one.

      Comment


        #4
        Re: Alpha Holidays

        Thanks Stan for additional info....

        A further question that comes to mind....the way it is stated, Alpha will only use ONE of the two tables and not a combination of the two....IOW the ones a user (developer) can add are not in addition to the existing default holidays but would replace them? So if even ONE additional holiday would be wanted in the list to be used, ALL holidays would have to be in the list? Seems so. And does the list continue automatically for succeeding years when a holiday has a set date?

        Also, what about recurring holidays like Thanksgiving (Fourth Thursday of November) which does not have a set date? Any way to have this added to the list? Just curious if you have knowledge as am sure it will be an issue some time or another eventually.
        Mike
        __________________________________________
        It is only when we forget all our learning that we begin to know.
        It's not what you look at that matters, it's what you see.
        Henry David Thoreau
        __________________________________________



        Comment


          #5
          Re: Alpha Holidays

          I've never used the feature, just remembered the mention in the docs.
          There can be only one.

          Comment


            #6
            Re: Alpha Holidays

            Rather than using Alpha's holiday file, we set up our own table which can be accessed by functions such as Bus_Days_Between(). A form has a button to extend all holidays one more year. Not having smart rules (e.g. third Thursday of the month), it simply takes the holidays of the last year on file and appends records using the same days of the months (as a guess). After doing such, the user will have to edit the new dates so that Good Friday falls on a Friday, etc.

            So, like Mike described, our system is more or less manual for one time per year. But it doesn't require typing in all of the holiday names - merely adjusting the dates where appropriate.

            Steve

            Comment


              #7
              Re: Alpha Holidays

              Originally posted by Steve Andrews View Post
              ...it simply takes the holidays of the last year on file and appends records using the same days of the months (as a guess)...
              Here is a function that can be put in a loop to correctly return the date of common holidays:

              http://msgboard.alphasoftware.com/al...hlight=holiday
              Peter
              AlphaBase Solutions, LLC

              [email protected]
              https://www.alphabasesolutions.com


              Comment


                #8
                A liittle help on this

                I initially set up holidays in preferences. However my formula does not seem to reduce the date count for the days. I also created a holiday table with same results. Coupled with the above I have searched the entire computer for a_holday.dbf table and it is not there. Reading the help I presume that when I create holidays in settings this creates the a_holiday table. If I create a table holiday_table then the program will look at this first before it looks at the other. Is this correct or am I confused? I have tried various things in the formula to get my answer but no matter what I do the holidays are still counted. The below is an example where holiday_table = the table I created

                BUS_DAYS_BETWEEN(DATEFROM,DATETO,"Yes","holiday_table")

                Comment


                  #9
                  Re: Alpha Holidays

                  Mark,
                  I have done this successfully a long time ago.
                  From memory the key is that the file location must be specified.
                  Use something like:

                  Code:
                  cHolidayFile = :a5.Get_Path() +  "\a_holidays"
                  BUS_DAYS_BETWEEN(DATEFROM,DATETO,"Yes",cHolidayFile)
                  I think the file MUST be named "a_holidays.dbf" and it is best to put it in the application folder.
                  Garry

                  Comment


                    #10
                    Re: Alpha Holidays

                    Originally posted by Garry Flanigan View Post
                    From memory the key is that the file location must be specified.
                    .
                    .
                    .
                    I think the file MUST be named "a_holidays.dbf" and it is best to put it in the application folder.
                    Garry
                    Our file is named "Holidays.dbf", it's located in the database folder, and we never specify the path when using the related functions. It works fully well in calculating the BUS_DAYS_BETWEEN().

                    I think that one factor may be the table structure. What is your field name for the date? Ours is simply "Date" which corresponds to that of a_holidays.dbf. Being an indexed field, we get the following:
                    Code:
                    ?exist({07/04/2008},"holidays","Date")
                    = .T.
                    It could be that the Alpha functions internally check the dates involved against a "Date" index to see if they are indeed holidays. This is just a hunch. I only know that we coincidentally have the same name as a_holiday.dbf for the date field and it works. I haven't tested it with a different field name.

                    Steve

                    Comment


                      #11
                      Re: Alpha Holidays

                      Based on Steve's statement I finally go this to work. What I found was the a_holiday.dbf table created by Alpha in settings was actually being stored in the user profile of windows, not the DB directory. This path I found in Settings Directory area. I confirmed this on two machines. The Holiday table that I created did not work as I named the date field "Holiday". When I changed it to "Date" as suggested by Steve, it worked.

                      Thank you for all input.

                      Comment


                        #12
                        Re: Alpha Holidays

                        In a multi-user environment the holiday table is certainly best kept in the application folder and, in order to eliminate any confusion, if you use the code I supplied, the application will never use the "local" holidays table. But as you are not using using the table name "a_holidays.dbf" that I use then your solution will still work.
                        I never thought of your field name being wrong as I just copied the Alpha "a_holidays.dbf" to my application folder and the name was therefore correct.
                        Garry

                        Comment


                          #13
                          Re: Alpha Holidays

                          Thanks Gary,

                          I did actually use your structure as well to achieve the result so I would like to acknowledge that as well. It confused me a little as I put this in the as a Field rule in a calc field. I could not rationalise the first line in the expression builder but ended up with

                          BUS_DAYS_BETWEEN(DATEFROM,DATETO,"Yes",:a5.Get_Path() + "\holiday_table")

                          Which worked. (After I changed the name of the Date field to Date)

                          Comment

                          Working...
                          X