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

Age Calculations

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

    Age Calculations

    I have been reading through the previous posts for ages to be calculated, however I guess I just dont understand. Here is what Im looking at. Here at the Police Dept, we have set up a datebase for all arrested subjects .. within that we have many fields to describe the subject, 20 such fields to be exact, such as name, dob, sex .. etc. Once I enter the DOB, I want to know how to have it calculate the age. I need a real basic explanation. Every time I try and enter it, I get the dreaded "Error."
    Now, Part II.
    With that age, is it possible to have, in another field, it automatically select the text JUVENILE for those ages under 18 y/o and ADULT for those 18 and over?

    Thanks for anyone that can help. It is much appreciated.

    #2
    RE: Age Calculations

    There are 3 functions involved: DATE() YEAR() IF()

    You'll need to define this expression:

    YEAR(DATE()) - YEAR(DOB)

    The YEAR(DATE()) function isolates the current year within your computer's system date field.

    The YEAR(DOB) isolates the year for the database field called DOB.

    For example, if the DOB were 05/18/1983, then the expression would would SHOW: 21 (i.e. 2004 - 1983)


    Here's what you need

    1. make sure that the DOB field is type D
    2. add 2 new fields to your database

    AGE N 3
    Juvenile C 7

    3. edit your field rules, select the AGE field, specify it as calculated, and type in the expression

    YEAR(DATE()) - YEAR(DOB)

    4. select the JUVENILE field, specify it as calculated, type in the expression:

    IF( YEAR(DATE()) - YEAR(DOB) " 17, "JUVENILE", "")


    This expression sttes that if the 2 dates are subtracted and the result (i.e. 21) is LESS than 17, then display the word JUVENILE. If the result is 17 or greater, then do not show anything in the field.


    5. after you've set this up, you need to do a one time recalculation for the entire database. You do this by re-evaluating your field rules.

    gm

    Comment


      #3
      RE: Age Calculations

      Sorry, that was for Alpha4 not ALPHA5 Version 1.

      I'll get you a corresponding message for version 1 shortly.

      gm

      Comment


        #4
        RE: Age Calculations

        Actually, what I've sent you in the first email does apply. I just tested it and it works fine.

        One slight formula change that you can incorporate is the if statement:

        IF (AGE " 17, "JUVENILE", "")

        This makes it more efficient.

        gm

        Comment


          #5
          RE: Age Calculations

          Here is a function to calculate age.

          function Age as N(DateVal as D)

          years = val(left(cdate(date()),4))-val(left(cdate(DateVal),4))
          if val(right(cdate(date()),4))"=val(right(cdate(DateVal),4))
          age = years
          else
          age = years - 1
          end if

          end function

          If you plug in a date, like DOB, into the function, it will return the current age.

          Jerry

          Comment


            #6
            RE: Age Calculations

            Great. I will try the modification tonight. Thank you all who replyed. The department really appreciates the help.

            Comment


              #7
              RE: Age Calculations

              Dakota,
              I would NOT place the calculated field of the actual age into the database. I know this sounds strange, but what happens next year, or the year after, or ...

              If you really want to SEE someone's age, place the calculated field on the screen or report. Then you won't need to recalculate the calculated fields within the database each time you open it. If this is an "arrest" database, you may want to keep the age that they were arrested, but otherwise,I would recommend against it.

              Tom

              Comment


                #8
                RE: Age Calculations

                Tom

                Is the age that is being collected the age of the subject at the time of the incident or the current age of the subject?

                In the first case the age is static, the second case is the age is dynamic - changing once a year.

                Your warning is appropriate for the second case, but not the first. And since there will be reports based on the age of the subject at the time of the incident, this would be a good use of storing that value.
                Al Buchholz
                Bookwood Systems, LTD
                Weekly QReportBuilder Webinars Thursday 1 pm CST

                Occam's Razor - KISS
                Normalize till it hurts - De-normalize till it works.
                Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                When we triage a problem it is much easier to read sample systems than to read a mind.
                "Make it as simple as possible, but not simpler."
                Albert Einstein

                http://www.iadn.com/images/media/iadn_member.png

                Comment


                  #9
                  RE: Age Calculations

                  Nothing like re emphazing the point you made in the last lines. Sorry about that.....
                  Al Buchholz
                  Bookwood Systems, LTD
                  Weekly QReportBuilder Webinars Thursday 1 pm CST

                  Occam's Razor - KISS
                  Normalize till it hurts - De-normalize till it works.
                  Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                  When we triage a problem it is much easier to read sample systems than to read a mind.
                  "Make it as simple as possible, but not simpler."
                  Albert Einstein

                  http://www.iadn.com/images/media/iadn_member.png

                  Comment


                    #10
                    RE: Age Calculations

                    I guess I was under the impression that it was always "updateing" the age field whenever viewed.
                    SO... to change this to a "viewed" aged onscreen, what changes should I make?
                    Remember, gotta keep this simple for me, were a bunch of cops here...hehe.

                    I do have to say that ths Chief of Police is loving how this database is working and starting to look ... your help is greatly appreciated by all us us here.

                    -Dakota

                    Comment


                      #11
                      RE: Age Calculations

                      Ok. I think I have found a solution to the age question. Instead of having a single "age" field, I have created an age field for every offense. This way we can tell the age that the offense was commited, which is actually much better for us. HOWEVER, it is only showing the first item line of ages ... the 2nd and third offenses do not show the ages. BUT - if you go into edit mode, the ages show up and are viewable. As soon as you hit save, they dissapear.
                      Example...
                      In View mode: http://dakotaskustoms.com/images/ALPHA01.jpg

                      in Edit Mode: http://dakotaskustoms.com/images/ALPHA02.jpg

                      Any Ideas? Ive done the "re-evaluate rules" multiple times with no luck.

                      Comment


                        #12
                        RE: Age Calculations

                        After a long night of trial and error, I have made progress. The previous problem has been cured.
                        I need to add one small adjustment to my
                        "" IF (OFAGE1 " 18, "JUVENILE OFFENSE - DO NOT RELEASE INFO", "") "" function however. How can I limit this to just those that at 0 - 18. (sometimes when an offense is enetered with no date, it pulls "JUVENILE OFFENSE - DO NOT RELEASE INFO" data in because of an -date (Not an issue for me, I just want to have it from 0-18 yrs of age that the function will show up.) I have tried the .AND. function but is asking for a T and F. and I cant get the .OR. to include "" 0" as part of the equation. Im just confused (as usual).

                        Thanks,
                        Dakota

                        Comment


                          #13
                          RE: Age Calculations

                          Dakota,
                          The time of your post is 3:58 AM. Are you working the graveyard shift???

                          try this:

                          IF (between(OFAGE1,5,18) "JUVENILE OFFENSE - DO NOT RELEASE INFO", "")

                          What this does is to restrict the the age for the years of 5 and 18. I really don't think you need to check for kids under 5. If so, just lower that number.

                          Good luck,

                          Tom

                          Comment


                            #14
                            RE: Age Calculations

                            Tom -
                            Yup, I'm the night owl here at the station....lucky me

                            Thanks for the suggestion, Ill give it a try.

                            -Dakota

                            Comment

                            Working...
                            X