N
Nick
OK, let me explain the subject a little better. Please note, I have not yet
built the query, I am still working on the "how to" part of it.
I have a table that stores Purchase Order information. This is a LARGE table
and contains all the relevant information of one Purchase Order. It is
essentially the "End Product" of the entire Database (its reason for being).
The table is the main driver to support financial management, data tracking
and to - pertinant for this question - review all suppliers for past
performance. As such, the table includes the Purchase Order Decision
information and quotation information.
I also have a table that is a list of all the Companies/Suppliers we deal
with. Nice and simple table, nothing out of the ordinary. Oh, and this table
has the Primary Key as the Company Name. This has been set after MUCH
consideration of the naming convenstions for companies for us. What it means,
for this problem, is that the Company Name in the Purchase Order Table
(selected by drop down) is a WYSIWYG data field.
In order to "cross reference" and pull up all the records in the Purchase
Order table that relate to a specific company I use a Form with a Sub Form
(the Form is based on the Company Table, while the Sub-Form is the Purchase
Order Table). This allows personnel to review previous company performance
FOR THE CURRENT FINANCIAL YEAR.
This is where the problem starts. At the end of each FY, the information in
the Purchase Order Table is ammended to another table (called Past Purchase
Order Information). All the Company Names are transferred to the Past
Purchase Order Table and the Past Purchase Order Table does not have any
relationships with anything - it is just a data table for datamining. The
Purchase Order Table is then reset for the new Financial Year.
The Purchase Order, and Past Purchase Order tables uses the Company Name as
a drop down field in six seperate fields (each named differently in the
Purchase Order Table). These fields are:
Quotation 1 Company Name
Quotation 2 Company Name
Quotation 3 Company Name
Quotation 4 Company Name
Quotation 5 Company Name
Winning Quotation Company Name
In the Past Purchase Order Table, this is just a text name of the company.
How do I query the Past Purchase Order Table to return ALL Records where a
Company Name has been used in one of the fields, ie:
Record 1 - Company 1 quoted (in Quotation 2 Company Name)
Record 2 - Company 1 quoted (in Quotation 4 Company Name) and won (Winning
Quotation Company Name)
Record 3 - No field has Company 1 in it.
The Query should return the information in Record 1 and 2, but not 3.
The default value for a Company Name field in the Purchase Order Table is
"None".
Yes, I know I could structure the database differently; however, the above
structure is the "best fit" for all the other reports and information that is
to be collated and actioned. Also, I have trying to minimise the database to
tables and queries where possible, to reduce maintenance issues with broken
code and/or macros.
I thank you all for any help.
Cheers
built the query, I am still working on the "how to" part of it.
I have a table that stores Purchase Order information. This is a LARGE table
and contains all the relevant information of one Purchase Order. It is
essentially the "End Product" of the entire Database (its reason for being).
The table is the main driver to support financial management, data tracking
and to - pertinant for this question - review all suppliers for past
performance. As such, the table includes the Purchase Order Decision
information and quotation information.
I also have a table that is a list of all the Companies/Suppliers we deal
with. Nice and simple table, nothing out of the ordinary. Oh, and this table
has the Primary Key as the Company Name. This has been set after MUCH
consideration of the naming convenstions for companies for us. What it means,
for this problem, is that the Company Name in the Purchase Order Table
(selected by drop down) is a WYSIWYG data field.
In order to "cross reference" and pull up all the records in the Purchase
Order table that relate to a specific company I use a Form with a Sub Form
(the Form is based on the Company Table, while the Sub-Form is the Purchase
Order Table). This allows personnel to review previous company performance
FOR THE CURRENT FINANCIAL YEAR.
This is where the problem starts. At the end of each FY, the information in
the Purchase Order Table is ammended to another table (called Past Purchase
Order Information). All the Company Names are transferred to the Past
Purchase Order Table and the Past Purchase Order Table does not have any
relationships with anything - it is just a data table for datamining. The
Purchase Order Table is then reset for the new Financial Year.
The Purchase Order, and Past Purchase Order tables uses the Company Name as
a drop down field in six seperate fields (each named differently in the
Purchase Order Table). These fields are:
Quotation 1 Company Name
Quotation 2 Company Name
Quotation 3 Company Name
Quotation 4 Company Name
Quotation 5 Company Name
Winning Quotation Company Name
In the Past Purchase Order Table, this is just a text name of the company.
How do I query the Past Purchase Order Table to return ALL Records where a
Company Name has been used in one of the fields, ie:
Record 1 - Company 1 quoted (in Quotation 2 Company Name)
Record 2 - Company 1 quoted (in Quotation 4 Company Name) and won (Winning
Quotation Company Name)
Record 3 - No field has Company 1 in it.
The Query should return the information in Record 1 and 2, but not 3.
The default value for a Company Name field in the Purchase Order Table is
"None".
Yes, I know I could structure the database differently; however, the above
structure is the "best fit" for all the other reports and information that is
to be collated and actioned. Also, I have trying to minimise the database to
tables and queries where possible, to reduce maintenance issues with broken
code and/or macros.
I thank you all for any help.
Cheers