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 field in A5 v 5

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

    Time field in A5 v 5

    I would like to create a time field for appointments in which records could ordered in "time order" - is this possible ?.

    #2
    RE: Time field in A5 v 5

    Hi Micheal

    The answer is yes. But the you will have to set the fields a C. You must also decide if you are using the 24 hour clock.

    Keith Hubert
    London.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      RE: Time field in A5 v 5

      Do you want to use AM/PM or 24 hour time?

      Everyone has a different solution. Personally, I like using 24-hour time so I create a 5-character field with a field rule mask of 00:00 That�s all you have to do.

      However, if you want AM/PM, there are several different ways of doing such. I use the same exact field described above and then I create a second field called AM/PM, which is a character field with a width of 2. I then create a simple lookup list in field rules which contains only two choices AM and PM, with the �Force Closest Match� option checked.

      I then create a third field, which is a calculated field that combines the two above.

      The tricky part is creating a field rule that calculates elapsed time. That isn�t too hard, but it gets very tricky if you go past midnight into the next day. We can help with that.

      Robert T.

      Comment


        #4
        RE: Time field in A5 v 5

        Michael,

        From page 318 of the user guide:
        :There is no Time data type in Alpha Five. Times are expressed by character values in the form
        "DDD:HH:MM:SS" and its variations. However, using the TOTIME and TOSECONDS functions,
        you can perform time arithmetic. For example, you can compute the number of seconds between
        time values, or compute a new time by adding or subtracting a specified number of seconds to a
        starting time."

        However, there appears to be a conflict in that, because even though you cannot define a column as type "Time",
        You can dim a variable as type Time.

        Eg:
        dim timenow as T
        timenow = now()
        ?timenow
        = 05/08/2003 08:18:03 86 am
        ?typeof(timenow)
        = "T"

        So while you cannot store a time in column (ask Alpha Software why), you can perform calculations with it in a script

        However, if you do not need the date portion of the time, the you could store the time in a character or numeric column:

        Dim ctime as c
        ctime = time()
        ?ctime
        = "08:37:05"

        numtime = toseconds(ctime)
        ?typeof(numtime)
        = "N"

        Comment


          #5
          RE: Time field in A5 v 5

          Melvin wrote:

          [So while you cannot store a time in column (ask Alpha Software why), you can perform calculations with it in a script]

          That is not true, I store time on a regular basis. It depends upon your definition of time. For me time is generally when an event starts and/or ends. For example, an employee arrives at work 08:00 and leaves work at 16:00.

          The calculation is a piece of cake for A5, the answer is obviously 8 hours. And you don't need a script to do the calculation.

          Robert

          Comment


            #6
            RE: Time field in A5 v 5

            Robert,

            I disagree, it is true. You cannot make a column of type 'time'.

            Yes, you can store 'time', but you must save it to
            a character (or numeric) data type as previuously
            described, and convert back for comparison.

            Are you saying you have created a column of type 'time',
            or just storing the value? There is a significant difference.

            I would be very interested to see if your table
            definition contains a column data type of Time. If so, could you please attach it for everyone else to benefit?

            Comment


              #7
              RE: Time field in A5 v 5

              Hi Melvin:

              You and I don't necessarily disagree, we're using different terminology and focusing in different areas. Maybe I wasn't clear the first time around. I thought that I came up with my personal definition of time and how it�s utilized in Alpha Five, which is a field that stores the time [value] of an event. I gave the example of someone who starts work at 08:00 and finishes work at 16:00. So yes I store those times [values] in character fields.

              Most of the time [no pun intended], people don't need the actual time the record was entered, which is where I think you are focused. There are occasions when that's appropriate, such as auditing changes to a record, you obviously want the exact date and time of that change.

              This thread began with a practical question from Michael M. reference sorting the time of specific events, which is quite typical. My previous post was a response to Michael's question.

              In the vast majority of cases, people need to store the value of an event[s], such as what time it stated and/or ended. So my point was simple, you can store time in A5 fields and then calculate the elapsed time of those events if you have a starting/ending time. However, my "practical definition" of storing time in terms of Michael's question is of course different than your definition.

              Robert T.


              Robert

              Comment


                #8
                RE: Time field in A5 v 5

                Thanks lads, all I would like to do is enter the time {09.30}, {09.45} for patient appointments and then sort the list starting with the 09.30 entry.

                If I can get to do this, I'm in business.

                Thanks
                Michael Mee

                Comment


                  #9
                  RE: Time field in A5 v 5

                  Hi Michael:

                  No problem, you can do that quite easily. However, you may want some field rules and I'll be glad to help, as will many other participants on this discussion board. Are you familiar with field rules?

                  For now, may I suggest you make a character field for the appointment time with a width of 5. T

                  Then go to Field Rules, select the Data Entry tab, choose �Simple Mask�, and create a mask as follows [those are zeros, not letters]

                  00:00

                  While you�re at it, you could make another validation field rule such as Appt_Time > 09:29 so that no one can enter a time prior to 09:30. You will probably want another validation field rule for the latest time.

                  At the very least, that will get you started and then you can easily sort by time in queries and reports. When you run across problems, come to this board for additional help.

                  Robert

                  Comment


                    #10
                    RE: Time field in A5 v 5

                    Michael,

                    Given your example, and hopefully, that you do not need to store using AM/PM prefix, then the following should work:

                    Given that time_column is type character (min length of 8),

                    tbl = table.current()
                    tbl.enter_begin()
                    tbl.time_column = time()
                    tbl.enter_end(.T.)

                    Since the 'time' will be military, ie: 24 hr format,
                    there should be no trouble sorting on the 'time_column';

                    If you need to due 'calculations' on the column, then
                    toseconds(timenow) will give you a valid numeric value.

                    Comment


                      #11
                      RE: Time field in A5 v 5

                      Thanks lads - I'm almost there

                      Regards

                      M Mee

                      Comment

                      Working...
                      X