Results 1 to 3 of 3
  1. #1
    sahana16 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    1

    Difference between dates (in days) month wise - MS Access 2007

    Hi all ,
    I am using Access 2007

    I have a table called "InsepctorLeaveDetails"

    InspectorId |Startdate | Enddate

    E1200 4/10/2013 4/25/2013


    E1203 3/10/2013 3/25/2013
    E1201 3/25/2013 4/10/2013

    Desired o/p

    InspectorId | InspectorName |Monthyear |vacation

    E1200 Suraj April 2013 15
    E1201 Damodhar April 2013 9
    E1201 Damodhar March 2013 6
    E1203 Shyam March 2013 15

    If the months in STARTDATE & ENDDATE are different , the no.of days must be split according to respective months .
    Please help me achieve this .

    Thanks in advance .
    Sahana

  2. #2
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Difference between dates (in days) month wise - MS Access 2007

    You can use the
    Day(Date)
    Month(Date)
    Year(Date)
    Functions to get the different parts of a date.

    E.g. Date = 1st May 2013
    Day = 1
    Month = 5
    Year = 2013

    To get the different between dates use the DateDiff Function.
    DateDiff(interval, date1, date2)
    DateDiff("d", ..., ...)

    You can format text as well
    Format(Date, "mmmm")
    e.g. May
    Or
    DatePart("m", Date)

  3. #3
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Difference between dates (in days) month wise - MS Access 2007


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

Similar Threads

  1. Replies: 0
    Last Post: 07-16-2012, 01:48 PM
  2. Month wise two years data comparison
    By waqas in forum Reports
    Replies: 2
    Last Post: 07-06-2012, 08:35 AM
  3. Difference between Dates/Times
    By dr4ke in forum Queries
    Replies: 3
    Last Post: 06-26-2012, 06:30 AM
  4. Select Dates between days and two days ago?
    By rstonehouse in forum Queries
    Replies: 4
    Last Post: 08-18-2010, 02:13 AM
  5. Count difference between two dates
    By Costa in forum Forms
    Replies: 3
    Last Post: 03-09-2010, 10:38 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