Results 1 to 4 of 4
  1. #1
    Paul-NY is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7

    including the difference between two dates in query result

    Hi


    I want to create a simple query in Access 2007 using Query Wizard that includes the difference between two date fields that are stored in the tables I am querying against among other data fields in the query result.

    How do I include both the date field values themselves and a field in the query result that calculates the difference between the two dates? This difference is not available in the tables.

    Paul

  2. #2
    compooper is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    87
    SELECT tblname.[Start Date Field], tblname.[End Date field], DateDiff("d",[Start Date Field],[End Date field]) AS [Date Diff]
    FROM tblname

  3. #3
    Paul-NY is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7
    Thanks Com. That would work, is there any way to incorporate it into the Query Design rather than writing it in SQL?

    Paul

  4. #4
    Rhino373 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    65
    Your third column in the query design in the "Field:" field would be like:
    Date Diff: DateDiff("d",[Start Date Field],[End Date field])

    Where "Date Diff" is any field name you so choose.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-14-2011, 07:19 AM
  2. Replies: 7
    Last Post: 09-24-2010, 07:23 AM
  3. Replies: 0
    Last Post: 06-06-2010, 08:23 AM
  4. Count difference between two dates
    By Costa in forum Forms
    Replies: 3
    Last Post: 03-09-2010, 10:38 AM
  5. Query including Null relationship?
    By David Criniti in forum Database Design
    Replies: 0
    Last Post: 08-14-2009, 09:10 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