Results 1 to 3 of 3
  1. #1
    akapag22 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    20

    difference in dates: Number of days

    Hi friends,

    This is my customer table

    RecordID Name Stage DOE
    1 Jack stage1 05/22/2015
    2 Jack stage2 05/24/2015
    3 Jack stage3 05/27/2015
    4 James stage1 06/10/2015
    5 James stage2 06/11/2015
    6 James stage3 06/12/2015
    7 Jack stage1 6/13/2015
    8 Jack stage2 06/13/2015
    9 Jack stage3 06/14/2015

    From the above dataset, I need to know the number of days the customer took from stage 1 to stage 3

    If stage 1 to stage 3 is one process, Jack has two processes so he would show up twice in the result but with different days

    Jack 05/22/2015(Stage1 DOE) 05/27/2015(stage3) 5 days
    Jack 6/13/2015 6/14/2015 1
    James 6/10/2015 6/12/2015 2

    How can i write a query to get the result as above...Thank You

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    This requires getting value from another record in same table. One way is with nested subquery. Review http://allenbrowne.com/subquery-01.html#AnotherRecord
    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.

  3. #3
    akapag22 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    20
    Thank You June. WOrked great.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-10-2015, 03:51 AM
  2. Replies: 5
    Last Post: 04-29-2014, 03:49 AM
  3. Replies: 2
    Last Post: 05-19-2013, 06:03 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. Replies: 4
    Last Post: 08-27-2009, 01:21 AM

Tags for this Thread

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