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

current time in a field using field rules

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

    current time in a field using field rules

    I have a embedded browse that contains the following fields.

    User - character field
    Description - character field
    Date - date field
    Time - time field

    I have set up a field rule for the date to be automatically filled in and it works fine. Simple default expression - date().

    I tried to do this with the time field using - time() but got an error 0. I have tried various functions which return this same error which I believe is to do with the wrong data type. The now() works but this results in the date and time being shown.

    I have read through a number of posts (about 30) but cannot find a solution but there definitely seems to be a lot of confusion. I have looked at the help file but it left me even more confused. To me it seems it should be simple. You have a time field and should have a function that puts the time into it (not the date). I tried changing the field to short time but that didn't help. Some of the posts suggested using a character field and then converting to time. The downside to this if I have understood the posts correctly is that after a global update all the times will be reset to the current time. This would be a problem.

    I am hoping someone can throw some light on how to use field rules to put the current time into a field.

    #2
    Re: current time in a field using field rules

    Try using the now() function. I have time fields and routinely populate them with it.

    Jeff

    Comment


      #3
      Re: current time in a field using field rules

      Ok. I tried changing to a character field and it works. Can someone explain what the time field type should be used for as it doesn't seem to work with the time function. I know I am probably using it incorrectly but it doesn't seem to be very intuitive. The date() with a date field makes sense but why doesn't the time() work with a time field? I really would like to know because even though the time is now being stored using a character field I don't understand why.

      Comment


        #4
        Re: current time in a field using field rules

        Geoff

        The time field actually stores both date and time. That's why time() alone won't populate it. If you use the now() function to populate it - you can then use field formatting to display what portion of the date and time you would like. For instance, you could choose to show the field as a date, a time, or a both.

        In all of my tables I record the date and time each record was added. I choose the formatting to display it as "01-31-2007 10:18 am".

        Regards,

        Jeff

        Comment


          #5
          Re: current time in a field using field rules

          Jeff,

          I tried the now() but it also inserts the date (see below).

          31/01/2007 03:16:43 56 pm

          All I want is the time.

          I changed the field type to character with a width of 5 and then set a simple field expression of Time("0h:0m:0s:pm"). This works but it seems odd that there is a time field type that doesn't have a function that just puts the time in. I'm hoping that I am wrong and there is a function that I've missed or I'm doing something wrong. Anyone?

          Cheers

          Geoff

          Comment


            #6
            Re: current time in a field using field rules

            Thanks Jeff.

            I missed your second post while I was replying. I will try that.

            Geoff

            Comment


              #7
              Re: current time in a field using field rules

              Originally posted by gmeredith17 View Post
              Ok. I tried changing to a character field and it works. Can someone explain what the time field type should be used for as it doesn't seem to work with the time function. I know I am probably using it incorrectly but it doesn't seem to be very intuitive. The date() with a date field makes sense but why doesn't the time() work with a time field? I really would like to know because even though the time is now being stored using a character field I don't understand why.
              The time() function was around long before there was a time data type and a time field type.

              it seems odd that there is a time field type that doesn't have a function that just puts the time in
              a time value without an associated date is essentially meaningless. If I ask you to meet me at 3:15 pm, you'd want to know on what date I mean, unless you assume I mean some particular day.
              There can be only one.

              Comment


                #8
                Re: current time in a field using field rules

                Try this in your calc values:
                Code:
                clock=upper(totime(toseconds(time()),12,0))
                Also to have time run on screen you will need to go to OnTimer and do a Refresh Object for the clock.

                Hope this helps.

                Pete Schuder
                "Ollie, remember how dumb I used to be? Well, I'm much better now."

                Pete

                Comment


                  #9
                  Re: current time in a field using field rules

                  Hi Geoff

                  Attached is a screen shot showing how to do what you want.

                  Regards,

                  Jeff

                  Comment


                    #10
                    Re: current time in a field using field rules

                    Jeff, Your solution worked a treat.

                    Stan, I have the date stored in a separate field. There are situations where the date may not be important. An action may occur everyday at a certain time. The date itself is then redundant information. However, this isn't the case with my application or with most scenarios I can think of so I can appreciate the logic behind it. I do believe there should be just a time function that returns the time and I guess it would be possible to write some xbasic code to achieve this but sadly my abilities are some what wanting.

                    Thank you all again for your help as I would be lost without it. Hopefully I will be able to support others in the same way one day.

                    Comment


                      #11
                      Re: current time in a field using field rules

                      Good deal Geoff! Glad I could help.

                      Comment

                      Working...
                      X