Eric wrote:
Quote:
Database is old which is running in my company and it contains more
than 100,000 records. I need the report and i dont know do i use the
query or do i write a VB method to fetch the record.
If you don't know how to write queries, you're in pretty deep trouble.
I would go out and get a good book on Access if I were you. John
Viescas's books are good, Roger Jennings is good. For Dummies books
are usually worthless.
I don't mean to be ugly at all, but making a badly denormalized
database functional is not that easy. If you absolutely have to leave
the database structure as is, I would union the repeating junk together
into a virtual table and use those to query.
There are just so many normalization problems with this database it's
not even funny.
Basic union query...
SELECT tbl_PPVResearch.AccountNum, FS_TechID1 As FS_TechID
FROM tbl_PPVResearch
WHERE tbl_PPVResearch.FS_TechID1 IS NOT NULL
UNION ALL
SELECT tbl_PPVResearch.AccountNum, FS_TechID2 As FS_TechID
FROM tbl_PPVResearch
WHERE tbl_PPVResearch.FS_TechID1 IS NOT NULL
SELECT tbl_PPVResearch.AccountNum, FS_TechID3 As FS_TechID
FROM tbl_PPVResearch
WHERE tbl_PPVResearch.FS_TechID1 IS NOT NULL;
Do that with each table that has fieldName(1,2,3...)
Then you should be able to get reasonable queries out of this thing.
Once you've done that for all the screwy tables, base your queries on
these union queries. As long as you don't try to run updates and
deletes through these queries, you can get the information you need out
of it, I think.
God be with ya. You may need it.