Merging two time fields in a report and sorting by time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • db5pta
    New Member
    • Mar 2008
    • 4

    Merging two time fields in a report and sorting by time

    Hi all,
    need help with pulling two fields together into one for a report.

    Both fields are time fields and are on different tables.

    I want to pull them both together into one field on a report so that they can be sorted by time in one list.

    Any help,

    Gracias.
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hi, there.

    The tables should be joined in relevant way and the mentioned date fields may be concatenated. Thus obtained query could be used as report recordsource.

    [code=sql]
    SELECT ...... , tbl1.dteField1 & ' ' & tbl2.dteField2 AS txtBothDatesTog ether FROM tbl1 INNER JOIN tbl2 ON ...... ;
    [/code]

    Regards,
    Fish.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32661

      #3
      I think maybe you're talking about a UNION query.

      You don't give any details however, so helping further would be difficult.
      [CODE=SQL]SELECT *
      FROM [Table1]
      UNION ALL SELECT *
      FROM [Table2][/CODE]

      Comment

      Working...