G
Guest
I have got a weird problem, quite possibly the answer is "anything that
complicated should be done in SQL Server, not access," but I will ask anyway
because I am stuck working in access for now.
I am trying to create a data mart (or data warehouse) with a central summary
table. The table has a 8 part unique key and about 10 currency fields. I
actually made a seperate autonumber primary key, but the 8 part key is the
logical key of the table although 3 of the fields can be null.
For speed reasons I am trying to fill most of the information using append
queries rather than looping through the recordset using VBA code and doing
each insert/update. So, I have two aggregate queries which are grouped on
the 8 part key and I want to join these two together into a single select
query and then create an append query which puts the results of this master
query into the table. One of the queries will have 3 of the fields null all
the time, the other will have some rows with all 8 filled in, and some with 3
null and 5 with values. So, I join the queries together in a new query with
a LEFT OUTER JOIN and run it and what do it get? NOT what i should, there are
a bunch of records missing. So, I figure it's the null values so i use the
nz(field,default) function to turn the possibly null fields into 0's or empty
strings depending on data type and try it again. I am still getting back
only records where the 3 optional fields are empty (string or 0).
It is like access is refusing to do a left join and forcing it to be an
inner join..??
I am a pretty decent developer so I am pretty sure it is not something
totally obvious.. I am just seeing some really weird behavior from access on
this.
I do not know if it is a problem with joining queries that are themselves
aggregate queries.. or if access has some kind of SERIOUS problem with doing
joins on fields that can be null, even if you use nz() to alter the value to
a non-null substitute.
I am quite stuck on this and looping through to insert/update each record
makes the process take 90 minutes instead of 20 minutes so if you can help I
would really appreciate it. If you have done anything like this in access
before, feel free to offer any advice you might have.
Thanks
complicated should be done in SQL Server, not access," but I will ask anyway
because I am stuck working in access for now.
I am trying to create a data mart (or data warehouse) with a central summary
table. The table has a 8 part unique key and about 10 currency fields. I
actually made a seperate autonumber primary key, but the 8 part key is the
logical key of the table although 3 of the fields can be null.
For speed reasons I am trying to fill most of the information using append
queries rather than looping through the recordset using VBA code and doing
each insert/update. So, I have two aggregate queries which are grouped on
the 8 part key and I want to join these two together into a single select
query and then create an append query which puts the results of this master
query into the table. One of the queries will have 3 of the fields null all
the time, the other will have some rows with all 8 filled in, and some with 3
null and 5 with values. So, I join the queries together in a new query with
a LEFT OUTER JOIN and run it and what do it get? NOT what i should, there are
a bunch of records missing. So, I figure it's the null values so i use the
nz(field,default) function to turn the possibly null fields into 0's or empty
strings depending on data type and try it again. I am still getting back
only records where the 3 optional fields are empty (string or 0).
It is like access is refusing to do a left join and forcing it to be an
inner join..??
I am a pretty decent developer so I am pretty sure it is not something
totally obvious.. I am just seeing some really weird behavior from access on
this.
I do not know if it is a problem with joining queries that are themselves
aggregate queries.. or if access has some kind of SERIOUS problem with doing
joins on fields that can be null, even if you use nz() to alter the value to
a non-null substitute.
I am quite stuck on this and looping through to insert/update each record
makes the process take 90 minutes instead of 20 minutes so if you can help I
would really appreciate it. If you have done anything like this in access
before, feel free to offer any advice you might have.
Thanks