Results 1 to 5 of 5
  1. #1
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176

    I want add two fields from differnet tables into one?

    The 2 main tables that I am working with are ChangeOrder and FieldOrder. I want to make a table (Orders) that has both.

    They are set up like this:

    ChangeOrder:
    ChangeOrderNumber (ID)
    ProjectCode (Can be multiple)
    ActualAmount ($)
    IssueDate

    FieldOrder:
    FieldOrderNumber (ID, but somehow there are repeats. Ex: One project can have FOCodes 1-6)
    ProjectCode
    ApprovedAmount
    DateAssigned

    I want to have a table that has
    Orders (FieldOrders and ChangeOrders)
    ProjectCode
    Amount
    Dates

    I literally just want to put one underneath another, combining the respective fields, how can I do this?

    Thanks!
    Last edited by offie; 06-25-2013 at 02:31 PM.

  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
    53,632
    Maybe you want a UNION query. There is no wizard or designer for UNION. Must type in SQL View of query builder.

    SELECT ChangeOrderNumber AS ID, ProjectCode, ActualAmount AS Amount, IssueDate AS Dates, "Change" AS Source FROM ChangeOrders
    UNION ALL SELECT FieldOrderNumber, ProjectCode, ApprovedAmount, DateAssigned, "Field" FROM FieldOrders;
    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
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176
    The issue I came up with while trying this is that the ChangeOrderNumber is text and the FieldOrderNumber is a number, I can't change the field types in the tables because they are linked tables, do you know how to change the type?
    Thanks for the union code!

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    I tested that scenario and the query works. The ID field is treated as text. Why is this an issue?
    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.

  5. #5
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176
    Wow thanks, sorry I must have been doing something wrong, I was using the tables that had the relationships present and it was adding code

    Thanks!

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

Similar Threads

  1. Lookup fields in tables
    By lefty2cox in forum Access
    Replies: 6
    Last Post: 05-23-2013, 01:28 PM
  2. Replies: 4
    Last Post: 09-19-2012, 02:07 AM
  3. Replies: 3
    Last Post: 08-18-2012, 03:25 AM
  4. tables fields
    By funi.t in forum Database Design
    Replies: 4
    Last Post: 01-13-2012, 01:20 AM
  5. MS Access on differnet PC's
    By Richard G in forum Access
    Replies: 2
    Last Post: 06-01-2011, 07:47 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