Results 1 to 2 of 2
  1. #1
    MarkHenderson is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    2

    Dlookup Function


    Good Evening,

    I am currently working with some data that is build in sequence with departure and arrival dates on each line, however I am looking to create a formula that will pull through the previous arrival date on to the line below, can anyone point me in the right direction :

    Below is the date

    Booking Number
    From City
    To City
    Departure Date
    Arrival Date
    Expr1
    Itinerary ID
    Test Itinerary ID 1
    8055623
    London Bangkok
    01/12/2012
    02/12/2012
    1
    8055623
    Bangkok Yangon
    02/12/2012
    02/12/2012
    8.28363154406892E-05
    2
    1
    8055623
    Yangon Bangkok
    14/12/2012
    14/12/2012
    5.79854208084824E-04
    3
    2
    8055623
    Bangkok London
    15/12/2012
    15/12/2012
    6.21272365805169E-04
    4
    3

    SELECT [Travel 2 - Flight Table 1].[Booking Number], [Travel 2 - Flight Table 1].[Test Itinerary ID 1], [Travel 2 - Flight Table 1].[To City], [Travel 2 - Flight Table 1].[From City], [Travel 2 - Flight Table 1].[Departure Date], [Travel 2 - Flight Table 1].[Arrival Date], DLookUp(CDate([Travel 2 - Flight Table 1]![Arrival Date]),"Travel 2 - Flight Table 1",[Travel 2 - Flight Table 1]![Test Itinerary ID 1] & [Travel 2 - Flight Table 1]![Test Itinerary ID 1]) AS Expr1, [Travel 2 - Flight Table 1].[Itinerary ID]
    FROM [Travel 2 - Flight Table 1]
    GROUP BY [Travel 2 - Flight Table 1].[Booking Number], [Travel 2 - Flight Table 1].[Test Itinerary ID 1], [Travel 2 - Flight Table 1].[To City], [Travel 2 - Flight Table 1].[From City], [Travel 2 - Flight Table 1].[Departure Date], [Travel 2 - Flight Table 1].[Arrival Date], [Travel 2 - Flight Table 1].[Itinerary ID]
    ORDER BY [Travel 2 - Flight Table 1].[Booking Number];

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Review http://allenbrowne.com/subquery-01.html
    especially the example 'Get the value in another record'
    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. DLOOKUP function
    By tariq1 in forum Programming
    Replies: 5
    Last Post: 07-17-2012, 04:22 PM
  2. DlookUp Function.
    By cap.zadi in forum Forms
    Replies: 11
    Last Post: 09-22-2011, 12:56 PM
  3. using the and function in a dlookup statement
    By englisap in forum Programming
    Replies: 10
    Last Post: 01-10-2011, 09:53 PM
  4. Format in Dlookup function
    By tpcervelo in forum Forms
    Replies: 6
    Last Post: 10-22-2010, 10:23 AM
  5. Need Help for Dlookup function
    By wasim_sono in forum Programming
    Replies: 5
    Last Post: 01-04-2006, 08:18 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