+ Reply to Thread
Results 1 to 2 of 2

Inner_Join Help

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Inner_Join Help

    I am trying to use VBA to automatically update queries each time a new table is created (the tables are created using excel and the updates would occur during this time). Now should I be using a one-many-relationship or inner_joins to link all tables together each week?

    If relationships are used then the below is true:
    Each week a new table is created with the prefix "Weekof". The new "Weekof" table will be linked to the table tblEmpNames while maintaining the existing links from all prior "Weekof" tables. The query TotalPoints would also be updated in that the sum column will now contain an additonal table in the sum column.

    If Inner_Join is used I think this would allow me to maintain one master table that sums each week in a simplified way. Is this true? I should be able to figure out which tables to inner join using vba code. When finding table names with VBA code the order they are added to an array, is that based on the name of the table? Or is that based on the creation date?

    I have this code for Inner_Join but I assume something is missing from it as nothing happens that I can notice.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Inner_Join Help

    Your SQL statement is correct, but do you usually use a SELECT statement to form a relationship between two tables? I'm asking because I honestly don't know.

    Also, creating a new table for each week's of data seems like bad way to set up your database. It would make more sense to have one table with a field for the week. Is there a reason you are setting up your database in this manner?
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1