Results 1 to 3 of 3
  1. #1
    sberti is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    33

    Join Tables with differing Dates

    I'm using data from 2 external sources. The data in both tables is Monthly data.



    Table 1 uses the 1st day of the month as the Date
    Table 2 uses the last day of the month as the Date

    In each table, I have concatenated the Dates for both like this:
    Month: DatePart("yyyy",[TableDate]) & "-" & DatePart("m",[TableDate])
    An example of the result is: 2012-11 (yyyy-mm)

    I can join the tables on these fields. So that works, ok.

    BUT I have a Third table that has data entered manually.
    In it, I have a field called YearMonth formatted as Text.
    When I enter 2012-11 in this field and try to join this field to either of the other tables, it doesn't work. It does not pull the data and for some reason the concatenated field displays the dash (-) only, no numbers.

    Can anyone help me join this Third table to either of the others?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You could try to make a new field in that 3rd table (untested)

    TheDatetoUse data type Date/Time

    fill it with
    Dateserial(Left(YearMonth,4), Mid(YearMonth,instr(YearMonth,"-"),1)

    Then use your DatePart approach to get the year and month for the join

    Just trying to help.

  3. #3
    sberti is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    33
    Thanks for your suggestions.

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

Similar Threads

  1. Join multiple tables to one
    By b6677862 in forum Queries
    Replies: 1
    Last Post: 02-08-2012, 06:59 AM
  2. inner join query with three tables.
    By fabiobarreto10 in forum Queries
    Replies: 2
    Last Post: 01-30-2012, 07:34 PM
  3. trying to Inner Join 3 database tables
    By gregu710 in forum Queries
    Replies: 2
    Last Post: 01-17-2012, 02:42 PM
  4. Join 4 Tables in 1 Query
    By sandlucky in forum Queries
    Replies: 5
    Last Post: 06-12-2011, 06:28 PM
  5. Join three or more tables in many to many link
    By elicoten in forum Database Design
    Replies: 3
    Last Post: 02-04-2010, 06:51 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