Alpha Video Training
Results 1 to 8 of 8

Thread: Combining 12 Databases

  1. #1
    Member
    Real Name
    NEAL NUSHOLTZ
    Join Date
    Jan 2007
    Posts
    5

    Default Combining 12 Databases

    Can someone please tell me how to combine several databases along a common field, like the date. Here is my problem. I have several bank accounts in several tables. Each account has a date and an amount (either deposited or withdrawn -- with a minus). I want to combine them all with one date column so that I can look across the data and see if money is going in and out of an account into another one.
    I can see how to "combine" two accounts, but I can not figure out how to combine many into one table. I tried using "join" to add one at a time and bumped into an error about not finding a referenced table. I don't know what I am doing except irritating myself. Can someone please help me? Ideally, I would like to only have one date for a particular date (instead of the date being repeated for each account where something happens on Jan 1st and getting Jan 1st repeated in the date column for each bank transaction.) It should look something like this:

    Date .Account 1 .Account 2 .Account3

    1/01 ....10,000 ... -10,000 ....2000

    In the example, I can see that on January 1, 10,000 came out of account 2 and went into account 1. Account 3 had an unrelated transaction. Your kindness would be appreciated.

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Combining 12 Databases

    I would suggest you create a new table. The fields in the new table would be

    date
    trans_1
    trans_2
    trans_3
    trans_4

    up to the number of accounts/tables you presently have.

    I would fill the records in the new table with all the possible dates to be checked. You could do this with xbasic or by appendiing just the dates from all your tables and then deleting all duplicates.

    I would then post from each of the individual account tables to a corresponding "trans_#" field based on the date field in each. You should wind up with what you describe.

    If you have more than one transaction per day per account, I don't think you can do what you want unless you summarize the individual account tables first.

    Once you have the table of all possible dates you could also try constucting a set with the new table as the parent and all the account tables as children. A browse of this set might be all you need.
    Last edited by Stan Mathews; 01-23-2007 at 01:07 PM.

  3. #3
    Member
    Real Name
    NEAL NUSHOLTZ
    Join Date
    Jan 2007
    Posts
    5

    Default Re: Combining 12 Databases

    Dear Stan:

    Thanks. I tried it. I made the master table, but I can't get past the append part. Maybe I've done something else wrong in setting up the tables. The error message that I get when I try to append is: "Variable append.m_exp1 expression - field is not recognized." I got this message before. This is compounded by the fact that I have no idea what I am doing. If I could just combine all the separate tables but have only one "date" column (and one "comment" column that I could later delete) I'd be happy. If I could just paste one beneath the other in the master table, I could sort them by date and it would work. I can't figure out how to just add one table to another. Neal

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Combining 12 Databases

    Quote Originally Posted by NNusholtz View Post
    The error message that I get when I try to append is: "Variable append.m_exp1 expression - field is not recognized."
    This is usually caused by a non-recommended field name in the table being "appended from".

    Table and Field Names

    Alpha Five recommends that table names, field names, and paths to your files start with a letter (A-Z or a-z) and be composed of letters, numbers (0-9), and underscore (_) characters. Do not use tilde "~" characters.
    While it is possible to use dashes, spaces, etc. they are counterindicated.

    I'll create you a date table. What range of dates do you want?
    Last edited by Stan Mathews; 01-23-2007 at 04:05 PM. Reason: attached dates table 10 yrs beginning 1/1/2005

  5. #5
    Member
    Real Name
    NEAL NUSHOLTZ
    Join Date
    Jan 2007
    Posts
    5

    Default Re: Combining 12 Databases

    Dear Stan:

    That's very nice offer, but I have too much work eliminating all the dates. I got the error message base on your clue as to the field error. I tried millions of things. Finally by sheer luck, I hit the button that said indexing and it showed the indexing for the date column. I got out of it and the error message went away. I will start up again on the project tomorrow. I think I can do it. At least, I would like to be able to do things like this. Next time I will create all of the fields ahead of time and just type the account information all into one database. Its easier to select them and remove them than it is to add them. Thanks for you help. I will let you know if I fail.

    Neal

  6. #6
    Member
    Real Name
    NEAL NUSHOLTZ
    Join Date
    Jan 2007
    Posts
    5

    Default Re: Combining 12 Databases

    Dear Stan:

    I now noticed something and maybe you know the answer. When I go to append, I was trying to append both the date field and the dollar transaction field in to the master table with all the bank accounts. On two of the databases, I can do that. On other databases, they only let me append one field and then when I try the second field I get the error message that the expression is not recognized. The name of the field is, like, A1065 (the last four digits of the account preceded by a letter). This phenomena fooled me into thinking I had solved the problem. Do you have an answer. I know you said just do the dates, but I am unfamiliar with "posting" and thought I could do it with the append feature. Thanks for your help.

  7. #7
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Combining 12 Databases

    If all the tables have the same structure, I can't imagine why one would fail to append while the others work. Examine the field names (and table name) of the problem table carefully as compared to the others.

    Posting is not much different from appending in terms of setting the correct values in the genie. I don't think appending is going to help you. Appending adds records to a table. You will have multiple instances of dates and related transaction information. If you open the default browse for the composite table and sort by date, you will be able to see the transactions for a date more or less as a series of multiple rows.

  8. #8
    Member
    Real Name
    NEAL NUSHOLTZ
    Join Date
    Jan 2007
    Posts
    5

    Default Re: Combining 12 Databases

    Dear Stan:

    The names of the tables that were causing problems had spaces in them. I think that was the cause of the problem. I guess before you walk, you have to crawl. And before I crawl, I guess, I have to lie face down in the dirt. Thanks for your help. I might not do it the most efficient way, but I think I can do it now.

Similar Threads

  1. Combining Two dialogs Into One
    By davej in forum Web Application Server v7
    Replies: 0
    Last Post: 05-19-2006, 10:13 PM
  2. combining table
    By Susie in forum Alpha Five Version 7
    Replies: 4
    Last Post: 01-25-2006, 01:50 PM
  3. Combining scripts?
    By samkerr in forum Alpha Five Version 7
    Replies: 4
    Last Post: 01-11-2006, 01:55 AM
  4. Combining data
    By Lamon Small in forum Alpha Five Version 6
    Replies: 2
    Last Post: 01-20-2005, 05:57 PM
  5. Combining databases for an Application
    By cawalton1 in forum Alpha Five Version 5
    Replies: 4
    Last Post: 06-03-2003, 08:33 PM

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
  •