Dear all mmbers and VB professionals,
=======================================
i need help in SQL Trigger :
i'm using VB 6.0 and MSSQL 2000
=======================================
Tables :
1. Stock
- code varchar(12) --->barcode
- names varhcar(50)
- qty int
2. Sale
- dos datetime --->date of sale
- code varchar(12) --->barcode
- qty int
- Price money
3. Purchase
- dop datetime ---> date of purchased
- code varchar(12) --->barcode
- qty int
- price money
3a. Purchase_Log
- dop datetime ---> date of purchased
- code varchar(12) --->barcode
- qty int
- price money
=======================================
Conditions :
* Purchase
if code not found in stock then "Addnew" in stock table with a complete data (barcode,item name,qty)
else
if found then just update stock qty = qty + purchase.qty
also INSERT INTO table "Purchase_Log"
* Sale
same condition
=======================================
Thank you very much for your help.
=======================================


Reply With Quote

