Results 1 to 2 of 2
  1. #1
    Bkper087 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    May 2014
    Posts
    81

    Modify length of Time to HH:MM in an expression based on Dlookup results

    I want to combine two times into one text box for visual sake on a report. When I combine it is shows the time in HH:MM:SS AM/PM format. The source is set to medium format which is HH:MM AM/PM. If I place the field onto the report directly, it shows correctly (as HH:MM). However, when I try to combine two fields in an expression using the Dlookup function i.e.: Dlookup (Time, Table, Criteria)&"-"&Dlookup (Time, Table, Criteria), the result shows the date in long form. How do I get it to show like this: MM:HH AM - MM:HH PM

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Try Format() function:

    Format(Dlookup (Time, Table, Criteria), "Medium Time") & " - " & Format(Dlookup (Time, Table, Criteria), "Medium Time")
    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. Replies: 7
    Last Post: 01-26-2016, 01:33 PM
  2. Replies: 5
    Last Post: 12-01-2014, 07:32 PM
  3. Replies: 6
    Last Post: 06-06-2014, 11:02 AM
  4. Replies: 1
    Last Post: 03-13-2014, 03:02 PM
  5. Converting a date to length of time
    By Duncan in forum Access
    Replies: 2
    Last Post: 11-10-2010, 05:53 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