Results 1 to 7 of 7
  1. #1
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    Due Vacation Calcaulations!

    I have a employee database.



    i want to make a query which can let me know about the next dua vacation of Employee. some of have after 6 months, some have after 1 year and some have after 2 years.

    so please advise how to calculate it from Hiringdate.

    thanks

    zee

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209
    I think the best approach is to maintain the structure of the employee record with the following fields:

    Hiring Date, Resumption Date, Freqency days, Due Date
    01-01-2011 01-01-2011......... 180 ...............30-06-2011

    The employee goes on vacation on 30-06-2011 and comes back, say after 15 days, let the resumption date updated to 16-07-2011. Let the initial hiring date remain as it is for record.

    You can calculate the Due Date column in the Query with the expression: [Resumption Date]+[Frequency Days]. The frequency in days is easier for calculations.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    You will need a field in table that identifies the period. All values in same unit (6, 12, 24 months) will make it easier. Then use DateAdd function. See http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Dears Thanks for the solution and it is working good.

    can i ask you teh question?

    how i can calculate the experience of the emp within the company like

    JoiningDate
    01/03/2009

    so what will be his exp within the company in years/months/days so far?

    thanks

    zee

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Sorry Sir,

    it is open to webpage but no text is there. seems article is remove or blocked.

    thanks

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    This is the code it offered:
    Dim Date1 as Date
    Dim Date2 as Date
    Dim Years as Integer
    Dim Months as Integer
    Date1=Cdate(txtDate1)
    Date2=Cdate(txtDate2)
    Years=DateDiff("YYYY",Date1,Date2)
    Months=DateDiff("M",Date1,Date2) - (Years*12)
    txtYIS=Format(Years) & " yrs " & format(Months) & " mth"

    Or try this one http://groups.google.com/group/micro...03152fa335dbe9

    Google:
    vba calculate service time
    vba calculate years in service
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Vacation Requests
    By MFS in forum Queries
    Replies: 3
    Last Post: 07-09-2011, 09:03 PM
  2. How to show current vacation time
    By Brian62 in forum Forms
    Replies: 1
    Last Post: 06-24-2011, 04:34 PM

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