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

Query Dilemma and I need a solution (HELP)

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

    Query Dilemma and I need a solution (HELP)

    I am working on a query for a client and I have hit a wall. I usually take great pleasure in figuring stuff like this out, but I am brain dead right now and running out of time.

    I have two tables in a set. The first table has employee personal information and the second table has the employee's check history. The tables are joined by an employee ID in a one to many relationship. (One Employee Information Record, Many Check Records) The information table has the date of hire and the checkhistory table records the checkdate, amount, etc.

    The question is we are looking for all employees who were hired only in 2005, but have not worked since the end of 2005. We are looking to archive records of employee's who have not worked for us for at least three years.
    We will then run the query for employees hired in 2004, but have not worked since the end of 2005 and so on. The reason why I am doing it year by year is because we will also be removing the associated paper records and they are stored alphabetically by year.

    The query I thought would work is:
    Condition 1: Entrydate in applicants is in the year 2005 AND
    Condition 2: (Exclude) checkdate is after 12/31/2005

    I built the query in the query builder and the resulting query is:
    (year(Entrydate) = 2005 ) .and. .not. ((Checkhistory->Checkdate > ctod("12/31/2005") ))

    Unfortunately I think this query only removes the records where the checks from employees are after 12/31/2005, it does not give me a list of employees who have not received a check since 2005. The strange thing is the check records from 2006 are displayed in the default form, but the record count did go lower.

    The client I am doing this for is an agency which during the good days were employing 20,000 people a year. Even though many of them only worked 1 or two weeks. But we still send out over 20,000 W2's each year. The Information for the W2's are gleaned from the same tables.

    Thank you very much for any help that is offered. I hope this is an easy question for someone and I am just blind to the easy answer.

    Any help would be greatly appreciated.
    ---------------------------------------------------
    Barry Kucher
    http://www.411tech.org

    #2
    Re: Query Dilemma and I need a solution (HELP)

    OK...My brain is still working...Somewhat....

    I created a new set with a one to one relationship (Last Matching Record) and then when I performed the same query Alpha gave me the correct results.

    If anyone else has a suggestion, I would still appreciate hearing it.
    ---------------------------------------------------
    Barry Kucher
    http://www.411tech.org

    Comment


      #3
      Re: Query Dilemma and I need a solution (HELP)

      Barry,
      You could also use tablemax() for the second half of your filter so that if tablemax() <2005......using the same year function and whatever other parameters/arguments are needed in the function.

      http://support.alphasoftware.com/alp...TABLEMAX().htm

      maybe something like
      tablemax("Checkhistory", "employee="+quote(employee), "Checkdate")
      Last edited by MikeC; 12-18-2008, 03:01 AM.
      Mike
      __________________________________________
      It is only when we forget all our learning that we begin to know.
      It's not what you look at that matters, it's what you see.
      Henry David Thoreau
      __________________________________________



      Comment


        #4
        Re: Query Dilemma and I need a solution (HELP)

        I don't think using that function would work. If the function limited the table to records less than 2006, it would'nt show records in the out years (2006, 2007) even if they existed. Correct?

        I need to know if records exist in those out years and if they do, I don't want the parent records displayed.

        Again, it is late, and I am now questioning every thought I and others have.

        I am shutting down and hopefully in the morning (later this morning) it will make sense.

        Thanks for the QUICK reply.
        ---------------------------------------------------
        Barry Kucher
        http://www.411tech.org

        Comment


          #5
          Re: Query Dilemma and I need a solution (HELP)

          You would know best, but seems to me by testing for basically the last check date (tablemax() ) of an employee, and if that date comes prior to 2006, then that employee has not worked after 2005.

          --mistake in last post where it would be tablemax(....)<2006 (not 2005).

          Look at it with fresh eyes in the morn...I will do the same. :)


          EDIT: now second guessing myself! Reread question..should be >2005 or >=2006....had it backwards--I excluded the non-working employees.
          Mike
          __________________________________________
          It is only when we forget all our learning that we begin to know.
          It's not what you look at that matters, it's what you see.
          Henry David Thoreau
          __________________________________________



          Comment


            #6
            Re: Query Dilemma and I need a solution (HELP)

            OK...Now I understand. I would write an expression for the query that would check for the last date of a payroll check. If it was after 12/31/2005 then they worked after the cutoff.

            I thought tablemax() only worked on the whole table, where it would give me the latest date for the entire table not individual records.

            I will definately try it. If it works, I can see where it will make it easier instead of having to create another set for each table.
            ---------------------------------------------------
            Barry Kucher
            http://www.411tech.org

            Comment

            Working...
            X