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 CARD

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

    TIME CARD

    Alpha V9

    I tried all night to figure out how to subtract one time from another time to calculate the number of hours an employee worked.

    Briefly the scenario:

    TABLES:
    1st table: Field name: Time Character: Time Field rule: Now()
    2nd table: Field name: Time_Out Character: Time Field rule: Now()

    TABLE SET:

    I combined these two tables to a table set so I could make a report like this:

    REPORT:

    Employee Time Time_Out Hrs Worked
    John 04/08/09 05:12:47 28 pm 04/08/09 07:12:58 67 pm ????

    Where do I insert a calculation and what calculation formula do I use to convert the Time Character Fields to give me number of hours?

    Sincerely, Kathy

    #2
    Re: TIME CARD

    I don't see how your fields can be character with a field rule expression of now(). Now() returns a time data value.

    Time1-time2 = number of seconds. You just have to translate the seconds into hours and minutes.
    There can be only one.

    Comment


      #3
      Re: TIME CARD

      Yes, absolutely, I should have used the structure name "Type" instead of "Character". Very confusing.

      I have tried that "time_out"-"time" (both of those are my field names) in:

      1. as a field rule in the table set (creating a new field in one of those tables called "hours")

      2. in the report as a new calculated field.

      3. on events in the new field

      All I get is a box looking item on the report.

      I must be putting this calculation in the wrong place or do I need to "embellish" it depending on where I put the calcuation?

      Where should I be putting the calculation?

      Sincerely, Kathy

      Comment


        #4
        Re: TIME CARD

        The expression would be

        time_out-time without the quotes.

        If you don't get an error but can't see/read the results, the object representing the results is not formatted with enough space to display it. Right click on the object, check the format tab.

        Where should I be putting the calculation?
        The report calculated field would be my choice.
        There can be only one.

        Comment


          #5
          Re: TIME CARD

          GROAN! I sort of remember back in those cobwebs about the formatting space! If this was the real issue after all those hours of trying different formulas! I'll let you know how this goes--not at that computer right now

          Thank you, Kathy

          Comment


            #6
            Re: TIME CARD

            Hi Kathy,
            Not sure what you are trying to do, but perhaps this will help for calculating hours:

            I have a table with these fields (lots of others, too)

            EID - character field, 7 - this holds the employee id number
            Datebeg - date field
            Timebeg - character field, 5
            Dateend - date field
            Timeend - character field, 5
            hours - numeric 8,2


            The hours field is a calculated field, using this function: THOURS(DATEBEG,TIMEBEG,DATEEND,TIMEEND)

            The function thours() is user defined function with this as the code:

            function thours as n(d1 as d,t1 as c, d2 as d, t2 as c)
            'd1 is begin date as date field
            'd2 is end date as date field
            't1 is begin time
            't2 is end time
            'times are in 4 digit format plus AM or PM indicator. / is AM * is PM
            'this is done to facilitate time entry using numeric keypad
            ' 9:05AM would be input as 0915/ 11:23PM would be input at 1123*
            thours = (jdate(d2)-jdate(d1))*24 + (val(chours(t1,t2)))+ (if(sign((val(chours(t1,t2)))) = 0,1,sign((val(chours(t1,t2)))))*((val(substr(chours(t1,t2),at(":",chours(t1,t2),1)+1,2)))/60))
            end function

            Notice what the remarks are in this code. It says to data enter the time using this format:
            4 digits plus either a / or a *. The forward slash and the star are both keys on the numeric keypad so the data entry can be done on the numeric keypad totally, without having to use the regular keys for the AM/PM stuff.
            The / indicates the time as AM, the * is for PM. So as the notes say enter 9:15AM as 0915/ or 1:30PM as 0130* that makes data entry pretty fast.

            your data file would look something like this:

            EID DATEBEG TIMEBEG DATEEND TIMEEND HOURS
            E000009 7/1/2008 1000* 7/1/2008 1100* 1.00
            E000009 7/1/2008 1000* 7/1/2008 1100* 1.00
            E000023 8/19/2008 1200* 8/19/2008 0400* 4.00
            E000023 8/20/2008 1200* 8/20/2008 0345* 3.75
            E000023 8/28/2008 0200* 8/28/2008 0315* 1.25
            E000026 10/30/2008 0200* 10/30/2008 0500* 3.00
            E000026 10/27/2008 1200* 10/27/2008 0130* 1.50
            E000028 12/15/2008 0100* 12/15/2008 0330* 2.50
            E000028 12/15/2008 0100* 12/15/2008 0100* 0.00
            E000028 12/15/2008 0330* 12/15/2008 0345* 0.25
            E000008 2/18/2009 0645* 2/18/2009 0800* 1.25
            E000008 2/19/2009 0830/ 2/19/2009 0930/ 1.00
            E000008 2/20/2009 0700* 2/20/2009 0800* 1.00


            This will accurately calculate the hours down to the minute for you and make data entry easy. When printing out the times in a report, use these calculated fields for the output:

            starttime = left(timebeg,4)+if(right(Timebeg,1)="/","AM",if(right(timebeg,1)="*","PM",""))
            endtime = left(timeend,4)+if(right(Timeend,1)="/","AM",if(right(timeend,1)="*","PM",""))
            Mike Reed
            Phoenix, AZ

            Comment


              #7
              Re: TIME CARD

              Kathy,

              I do something similar to what you're doing in a time clock program I created.

              When an employee clocks in I record now() in the clock_in field (long Time field). When they clock out I record now() in the clock_out field (also long Time).

              Hrs_worked = clock_out - clock_in with hrs_worked being a calculated field.

              It's that simple.

              Bob Arbuthnot

              Comment


                #8
                Re: TIME CARD

                Oh boy I'm back and programming again.

                Thank you ALL for replying. Stan suggested that perhaps I didn't have a long enough format in my report to know if my calculations were working or not. He was right.

                But I learned alot in the wee hours and I really appreciate the support. It encourages me to want to program more and try harder things because I know there are people like each of you who are willing to share. Sometimes I can even come up with some suggestions but usually you guys are talking way above me!

                Sincerely, Kathy

                Comment

                Working...
                X