Results 1 to 3 of 3

Thread: Weekly Report

  1. #1
    Join Date
    Dec 2003
    Posts
    138

    Question Unanswered: Weekly Report

    Ok,

    I'm sure this is simple, but I haven't programmed anything in a while, therefore I can't seem to wrap my head around it:

    I have a longevity database. An employee who stays in a position for 5 years + earns a specific amount of longevity pay depending on how long he/she is in the position.

    .05 - >=5 years but <10 years
    .10 >=10 years but <15 years
    .15 >=15 years but <20 years
    .20 >=20 years but <25 years
    .25 >=25 years

    Of course if the employee leaves the position for any other reason than a promotion, then he/she loses that longevity pay. I've solved that problem with a yes/no (true/false) checkbox. The box is unchecked, then he/she is eligible for longevity, etc.

    I have date add fields in a query to tell me what the dates are for each 5 year increment.

    I have a form that I can enter specific dates into to show which ones are currently due, but of course, it shows me all of the dates in each of the 5 year, 10 year, 15 year, etc. columns. I only want to see which specific dates that I've entered the criteria for.

    I would love if this could be automatically done with the push of a button. i.e. today + 7 days (report)

    Any suggestions - am I even close or on the right track??

    Thanks!!

  2. #2
    Join Date
    Dec 2003
    Posts
    138
    Ok, coming at this from another angle...

    Instead of doing it as I was before, I've deciding to filter it as such:

    Month - (no problem - have this in a query...certain dates by month.)

    Now - the question is:

    I have a field from a form that I type in the year - i.e. 2011.

    I want to take a date field (longevitydate) and subtract the current year from that date to get how many years apart they are.

    I don't want months, and days. I want to be able to pick, let's say April, and view the number of years from the longevity date to this year.

    i.e.:

    2011 - 1/1/1997 = 14 years

    I tried the DateDiff function, but can't get it to work for some reason.

    DateDiff("yyyy", [Forms]![Longevity Report]![Year], [LongevityDate])

    It's not working. Please help!!
    Last edited by dendalee; 11-01-11 at 11:09. Reason: I fixed it:

  3. #3
    Join Date
    Dec 2003
    Posts
    138
    I fixed the problem. I just have to enter the entire date as opposed to just the year. Works fine after that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •