L
larochy
Hi, I've created a database to track invoices sold, products purchased on
each invoice, and then projects that are initiated against the invoice which
is basically a bucket of consulting hours the customer bought from us for
services my company provides...ie. Application Engineers, Consultants,
Project Mgrs, etc. An invoice can have multiple projects attached to it and
I'm running into a problem when I want to run a query showing the invoices,
products purchased for each invoice, and the usage at the project level
against the invoice balance. I'm getting duplicates, see below for my table
structure. I'm sure I'm breaking some "normalization" rules in my tables but
I can't seem to get this to work. Any suggestions?
Invoice Table
Cust ID
InvoiceNumber<primary key>
Purchase Date
Company Code<currency code>
Invoice Products Purchased Table
SKU<primary key>
Expiration Date<primary key>
Qty
Total
Rate
InvoiceNumber<primary key>
Projects Table
Project ID<Primary key>
Project Description
InvoiceNumber
CustomerID
Project Status
each invoice, and then projects that are initiated against the invoice which
is basically a bucket of consulting hours the customer bought from us for
services my company provides...ie. Application Engineers, Consultants,
Project Mgrs, etc. An invoice can have multiple projects attached to it and
I'm running into a problem when I want to run a query showing the invoices,
products purchased for each invoice, and the usage at the project level
against the invoice balance. I'm getting duplicates, see below for my table
structure. I'm sure I'm breaking some "normalization" rules in my tables but
I can't seem to get this to work. Any suggestions?
Invoice Table
Cust ID
InvoiceNumber<primary key>
Purchase Date
Company Code<currency code>
Invoice Products Purchased Table
SKU<primary key>
Expiration Date<primary key>
Qty
Total
Rate
InvoiceNumber<primary key>
Projects Table
Project ID<Primary key>
Project Description
InvoiceNumber
CustomerID
Project Status