> This still isn't making sense.
> You seem to be saying that each table contains 3 fields, Building name,
[quoted text clipped - 62 lines]
> from
> > > > the other tables. Any suggestions? I can post my SQL code if needed.
Now it makes sense, Beth (though I don't know what an AS/400 is).
Create a table called TblDepartment.
Give it
DeptID (Primary Key, Autonumbe)
DeptName
Type in the names of your departments.
In each table, create a number field, DeptID. Ensure that the Default Value
is not 0. Also, create a tick field, Sorted, so you can indicate when a
building has been sorted out.
Use an Update Query to put the Correct DeptID in the DeptID field for each
table.
(more details available if needed)
for the sorted table, use the Update Query to also set Sorted to True
Once you have done this, you can use an Append query to append the buildings
into one table, giving that table a primary key.
If buildings can be in more than 1 department at a time, or need to keep a
record of departments that they were in, in the past, then your next step in
normalizing your db will be to create a seperate table for the buildings
while your BuildingDepartment table will hold the foreign key field BuildID
from the Building table and DeptID from the departments table.
Alternatively, there is that Union Query.....
Evi
> They actually started out as 5 different Excel files that were exported from
> the AS/400. Each department here in the district named the buildings
[quoted text clipped - 75 lines]
> > from
> > > > > the other tables. Any suggestions? I can post my SQL code if needed.
Beth Eadie - 23 Apr 2008 19:11 GMT
I couldn't get the update query to work properly, so I just did a union query
and everything works perfectly! Thanks so much for your help!
> Now it makes sense, Beth (though I don't know what an AS/400 is).
> Create a table called TblDepartment.
[quoted text clipped - 129 lines]
> > > > > > the other tables. Any suggestions? I can post my SQL code if
> needed.
Evi - 23 Apr 2008 19:27 GMT
What went wrong with the Update query. You will need to use it eventually to
Normalize your database. The Union query is just a temporary repair.
Evi
> I couldn't get the update query to work properly, so I just did a union query
> and everything works perfectly! Thanks so much for your help!
[quoted text clipped - 132 lines]
> > > > > > > the other tables. Any suggestions? I can post my SQL code if
> > needed.
Beth Eadie - 02 May 2008 17:46 GMT
Thank you, Evi, for all your help!
I redid the Update query and finally got everything to work. It seems like
if I did the Append query, it's almost the same as just doing a Union query
on all the tables. Is that correct? Since I would be appending the data
from all my tables into 1 table to pull my reports from.
Is there a difference between just doing a Union query or doing the Update
and Append queries?
> What went wrong with the Update query. You will need to use it eventually to
> Normalize your database. The Union query is just a temporary repair.
[quoted text clipped - 170 lines]
> > > > > > > > the other tables. Any suggestions? I can post my SQL code if
> > > needed.
Evi - 02 May 2008 22:05 GMT
An enormous difference.
I have 2 tables for my accounts database.
Once a year, I empty my expenditure table into an Archive table (using an
Append query)
But I want to compare statistics over several years so I use a Union query
to show both tables together while still keeping the data physically apart.
The advantage of doing a union query with tables you want to join, is that
you get to see visually if there are any discrepancies in the data or any
unforseen problems with joining them before you actually do so.
Imagine if (like one writer) you have 4 tables each representing a school
term's test results called Autumn Term, Winter Term and you innocently
joined them together before realizing that you needed a date field to tell
you which term each record occured in.
Evi
> Thank you, Evi, for all your help!
>
[quoted text clipped - 180 lines]
> > > > > > > > > the other tables. Any suggestions? I can post my SQL code if
> > > > needed.