Results 1 to 2 of 2
  1. #1
    jfiresto is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2013
    Location
    California
    Posts
    7

    One table with three date fields (all with short dates) can you combine them into one

    I have a table called Packages, in this table I have multiple fields with just short dates example of fields (ID), (Home_1), (Home_2), (Home_3) and (Home_4). What I was wondering is there a way to comine all of the Home fields into one for the purpose of counting the number of dates for all the records. Total number of dates of all the Home fields? I am using Access 2010

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    This is not normalized data structure. If it were, could do a simple aggregate (Totals) query. Since it is not normalized, use a UNION query to configure the data in normalized arrangement.

    SELECT ID, "Home1" AS Source, Home_1 AS DateValue FROM Packages
    UNION SELECT ID, "Home2", Home_2 FROM Packages
    UNION SELECT ID, "Home3", Home_3 FROM Packages
    UNION SELECT ID, "Home4", Home_4 FROM Packages;

    There is no wizard or designer for UNION query, must type (or copy/paste) in the SQL View of query designer.

    Now use that UNION query as the data source for an aggregate query.
    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: 1
    Last Post: 03-06-2012, 07:20 PM
  2. Datepicker set to short date: displays time?
    By sprovoyeur in forum Forms
    Replies: 3
    Last Post: 07-19-2011, 06:24 AM
  3. Short date comparison
    By andy101 in forum Programming
    Replies: 2
    Last Post: 03-17-2011, 04:36 AM
  4. Replies: 3
    Last Post: 11-19-2009, 09:15 PM
  5. Replies: 3
    Last Post: 08-02-2009, 03:52 PM

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