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

Time Between

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

    Time Between

    In Alpha 4v6 there is a function time between that was useful. I can't find an equivalent in A5v5. Toseconds and totime work but it gets complicated when the time spans a day change. I think I need a user defined function for this but I'm not sure I am capable of doing this. Has anyone else tackled this problem?

    russ

    #2
    RE: Time Between

    try http://www.learn alpha.com/timeexample/time_example.htm

    Comment


      #3
      RE: Time Between

      Thanks,
      Actually that was the first place I looked (well second, I did a search of the board first)
      Using your work as an example I came up with the following but it doesn't work. Any Idea why.

      FUNCTION Time_Between AS T (Date_In AS D, Date_Out AS D, Time_in AS T, Time_Out AS T )

      totime(toseconds(Time_Out)-toseconds(Time_In)+((Date_Out-Date_In)*24000),2,0)

      END FUNCTION

      When I put this on a test form it returns the name given it in the calc field set up to use it.
      Perhaps I'm using this wrong, but this seems like it would be the way to do it.

      Thanks,
      Russ

      Comment


        #4
        RE: Time Between

        On the last post the 2400 should be 3600*24, my error. This works fine as a calc field, which is what I will use. Still curious why the UDF didn't work. Thats the first time I have tried that.

        Comment


          #5
          RE: Time Between

          Russ:

          Try:

          FUNCTION Time_Between AS c (Date_In AS D, Date_Out AS D, Time_in AS c, Time_Out AS c )

          time_between = totime((toseconds(Time_Out)-toseconds(Time_In))+((Date_Out-Date_In)*86400),2,0)

          END FUNCTION

          Sorry, you can't dim a variable as t(time)...

          Craig

          Comment


            #6
            RE: Time Between

            What would the expression look like if you were trying to find if a
            given date and time were between Friday Nite/5 Pm and Monday Morning
            8 AM?
            efs

            Comment


              #7
              RE: Time Between

              Ed:

              I'm not exactly sure what you are looking for, but I'll try an answer.

              I think Russ was looking for a function to return the amount of time (HRS:MIN:SEC) that has elapsed.

              Therefore, with the above function:

              hours = time_between(ctod("05/17/02"), ctod("05/20/02"), "05:00 pm", "11:00 am")
              ?hours= "66:00:00"

              Now, of course, he'd be using field names in place of the dates and times in the above expression.

              In your example, the expression returns that 66 hours elapsed.

              Craig

              Comment


                #8
                RE: Time Between

                Hi Craig,

                Thank you for responding. I am converting an older A4V6 application to
                A5V4.5 that I had written in 1995 for a parcel delivery company. I
                need to learn if the pickup or delivery times are after Fri/5PM and
                if so before Mon/8AM, in other words were the pickup or delivery times
                after hours on a weekend. The pickup and delivery dates/times are all
                entered in separate fields prior to requiring the expression to make a
                decision of T/F.
                Thank you for your time,
                efs

                Comment


                  #9
                  RE: Time Between

                  try this function:

                  FUNCTION weekend_charges AS L (pickup_date AS D, pickup_time AS C, delivery_date AS D, delivery_time AS C )
                  dim pickup_day_of_week as n
                  dim delivery_day_of_week as n
                  pickup_day_of_week=dow(pickup_date)
                  delivery_day_of_week=dow(delivery_date)
                  select
                  case pickup_day_of_week=1 .or. pickup_day_of_week=7
                  weekend_charges=.t.
                  case delivery_day_of_week=1 .or. delivery_day_of_week=7
                  weekend_charges=.t.
                  case pickup_day_of_week=6 .and. (toseconds(pickup_time)>toseconds("5:00 PM"))
                  weekend_charges=.t.
                  case pickup_day_of_week=2 .and. (toseconds(pickup_time)toseconds("5:00 PM"))
                  weekend_charges=.t.
                  case delivery_day_of_week=2 .and. (toseconds(delivery_time)

                  Comment


                    #10
                    RE: Time Between

                    Thanks Craig,
                    I would have never guessed it was dimming the vbl as t, the option is there but you can't use it - go figure.

                    Thanks for the help, I'll set this up as a function.

                    Russ

                    Comment


                      #11
                      RE: Time Between

                      Whew ! Thanks a lot Peter, that must have taken some time and thought
                      to construct.

                      Thanks again .. Can't wait to try it,
                      efs

                      Comment


                        #12
                        RE: Time Between

                        the function didn't copy completely correctly because of HTML considerations. the line

                        case pickup_day_of_week=2 .and. (toseconds(pickup_time)

                        should be
                        [code]
                        case pickup_day_of_week=2 .and. (toseconds(pickup_time)

                        Comment


                          #13
                          RE: Time Between

                          still not coming across properly. it should be

                          case pickup_day_of_week=2 .and. (toseconds(pickup_time) less thantoseconds("8:00 AM"))

                          where "less than" is replaced by the less-than angle bracket symbol, which I can't get to show on this board.

                          Comment


                            #14
                            RE: Time Between

                            Good Morning Peter,

                            Thanks so much for noticing that and clarifying it. Knowing you are
                            always right I have been furiously looking for the reference to 8 AM.
                            I feel much better now that I can understand your coding. This saves me
                            tons of time developing the function and is characteristic of the
                            mutual help that is always available on this great phorum.
                            Where on earth would I be using Access,
                            efs

                            Comment


                              #15
                              RE: Time Between

                              This got me once a while back, so, out of curiousity...
                              case pickup_day_of_week=2 .and. (toseconds(pickup_time)"
                              toseconds("8:00 AM"))
                              Peter:
                              "
                              If the above comes out correctly, try "<" with no quotes to
                              create the less than sign... I think you also need to click "Use HTML"
                              Craig
                              "

                              Comment

                              Working...
                              X