Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
websyd
Starting Member
16 Posts |
Posted - 2006-11-08 : 04:43:48
|
| Please i have created some tables Delivary with this columns (DelivaryId,DelivaryNo,QtyRecieved,DelivaryDate,ProductId) and Product with this columns (ProductId,ProductCode,ProductName,ProductPrice) as you can see the product table keeps record of products whlie the delivary table keeps record of stock supplied. I will like to create another table that will keep record of stock sold out (Invoice Table) based on the qty recieved from the delivaries tablePlease help |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-08 : 05:08:34
|
| I think you have to provide more information. Sample data and expected output based on the provided sample data would be great.Or are you asking us how to build your system?Peter LarssonHelsingborg, Sweden |
 |
|
|
websyd
Starting Member
16 Posts |
Posted - 2006-11-08 : 07:47:47
|
| Thanks 4 d reply but im not asking that u should build one 4 me, just trying to get an idea how my application will be able to generate an invoice based on the quantity in stock and this quantity is in the delivaries table. Im a newbe |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2006-11-08 : 09:01:02
|
quote: Originally posted by websydI will like to create another table that will keep record of stock sold out (Invoice Table) based on the qty recieved from the delivaries table
Well you have your requirements right there...and that's derived dataWhat you would be better off doing is to create a view based on these reqs...BUTSample Data, DDL ect would help us help youRead the hint link in my sig and post what asks...you should have an answer in, oh, 5 minutesBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-11-08 : 09:54:10
|
| "I will like to create ... Invoice Table"We use two tables:Invoice Header Table====================Ref NoCustomer IDReference to Invoice AddressReference to Delivery AddressDateStatus (Invoiced, Paid, Cancelled, etc.)We also store:Tax MethodShipping methodShipping costTax costGoods costTotal cost (costs are to avoid having to calculate them in different places)Promotional Voucher(s)Customer Reference NoBatch NoPayment MethodGift flag / MessageDate customer wants deliveryEarly Payment DiscountAffiliate Refand a bunch of other stuffInvoice Item Table==================Ref No (FK to above)ItemProduct CodeQtyPriceWe also store:StatusDiscount PriceQty ShippedQty CancelledTax CodeTax AmountGoods AmountTotal Amountand a bunch of other stuff.Kristen |
 |
|
|
|
|
|
|
|