Results 1 to 4 of 4
  1. #1
    Tommy1005 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    3

    Calculate duration between two dates

    How would I make a query that does the following:

    Updates Column: "Duration from Start to RTT" in my table called SE_Report.

    The query updates the column with the number of days it has been since the date in the "Request Letter Sent Date" column and the "Trading Relationship Accepted" column. If there is no date in the "Trading Relationship Accepted" column then it just uses todays date.

    Examples:
    Request Letter Sent Date: 5/4/2012
    Trading Relationship Accepted Date: 5/9/2012
    So the column Duration from Start to RTT would have "5"

    Another is
    Request Letter Sent Date: 5/22/2012
    But there is no Trading Relationship Accepted Date so it uses todays date 7/1/2012
    So the column Duration from Start to RTT would have "39"

    Can anyone help me figure this out?


    Here is the Access file with my table.
    query.zip

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you looked at DateDiff() yet?

  3. #3
    Tommy1005 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    3
    Yes I'm still a newbie at sql though I only know select statements. Would this require a insert into statement?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I think this link should be helpful for you: http://allenbrowne.com/casu-14.html

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

Similar Threads

  1. Duration field NOT time
    By rockcliff15 in forum Access
    Replies: 6
    Last Post: 04-15-2012, 12:22 PM
  2. Replies: 8
    Last Post: 03-30-2012, 06:05 AM
  3. Count one event regardless of duration
    By jbr87 in forum Queries
    Replies: 8
    Last Post: 03-05-2012, 08:54 PM
  4. Replies: 1
    Last Post: 11-12-2010, 01:16 AM
  5. How to calculate duration in hours & minutes
    By joypanattil in forum Access
    Replies: 0
    Last Post: 11-25-2009, 04:49 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