Results 1 to 8 of 8
  1. #1
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    Calculating Next Contract Expired Date!

    Hi

    I am interested to calculate the Employee's next contract expired date:

    JoiningDate: 10/10/2013
    ContractPeriod (Years): 2 (*The contract will be renewed automatically after 2 years and so on. What is the next expired date)


    ContractExpiredon: 10/10/2017 (*Manually calculated)

    How this can be achieved via a query?

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Use DateAdd

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Given the parameters, I don't think it's as simple as that. You'd need a function that added 2 years, checked against the current date, if beyond fine if not add 2 more, etc. Personally I'd probably have a transaction table that recorded renewals, and add 2 years to the last one.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Thanks for the explanation.
    Yeah, you are right. May some employees promoted for higher positions and their contract will be one year contract instead 2 years later. Kindly any example or the example of function?
    How to do this?

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    It would be a custom function. Like I said, I'd probably have a table that recorded each renewal, a field in the employee file or somewhere that held the interval, and I'd calculate the expiration date from those.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Dear Paul

    I am not able to follow your idea. Kindly provide me some example or code, if you can.

    Regards

  7. #7
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Hello Sir

    Any Solid or working example?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    For the function? No, it would be custom to your situation. This may help if you're new to functions:

    http://www.baldyweb.com/Function.htm

    but again, I'd be more likely to have a transaction table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-29-2016, 04:03 AM
  2. Contract Termination Date Needed
    By dmunoz55 in forum Programming
    Replies: 3
    Last Post: 02-17-2015, 04:14 AM
  3. Timeout Expired
    By Raj in forum Access
    Replies: 3
    Last Post: 05-04-2011, 09:51 PM
  4. Expired Date Query Design
    By Bike in forum Queries
    Replies: 4
    Last Post: 03-30-2011, 02:46 PM
  5. Timeout Expired
    By brvaland in forum Database Design
    Replies: 0
    Last Post: 04-03-2009, 04:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums