/* */

Monday, November 22, 2010

[belajar-access] kawan kawan mohon bantuanya untuk program Status approval non approval saya

Kawan kawan, mohon bantuanya, saya punya suatu kasus neh wat nyari status aproval non approval..


terdapat 5 tabel. sebagai berikut :


1.tabel order
2.tabel item
3.tabel sales
4.tabel customer
5.tabel barang

field dalam tabel order :
* id_order (pk)
* id_customer
* no_order

field dalam tabel sales :
* id_sales (pk)
* id_item
* no_order
* line_order

field dalam tabel customer :
* id_customer (pk)
* nama_customer

field dalam tabel item :
* id_item (pk)
* kode_item
* nama_item

field dalam tabel barang :
* kode_barang (pk)
* approv_1
* approv_2


contoh isi 5 record :

*tabel order

id_order |id_customer |no_order
ord_001 | abb |pc001
ord_002 | toto |pc002
ord_003 | gt |tc001

*table sales

id_sales | id_item | id_order | line_no_order
sls_001 | itm_1 | ord_001 | 1
sls_002 | itm_2 | ord_001 | 2
sls_003 | itm_2 | ord_002 | 1
sls_004 | itm_3 | ord_002 | 2
sls_005 | itm_4 | ord_003 | 1


*tabel customer

id_customer | nama_customer
aab | pt.aab
gt | pt.gajah tunggal
toto | pt.toto


*tabel item

id_item | kode_item | nama_item
itm_1 | 20C001 | PVC/PVC
itm_2 | 23C002 | XLPE/PVC
itm_3 | 20C000 | XLPE
itm_4 | 24C002 | PVC


*tabel barang

kode_barang | approv_1 | approv_2
20C001 | -1 | -1
23C002 | -1 | 0
20C000 | 0 | 0

ket : no_order dengan isi PC =Power Cable,TC =Telepone Cable


relasinya seperti ini :

order.id_order = sales.id_order
order.id_customer = customer.id_customer
sales.id_item = _item.id_item


note :

* isi dari tabel barang adalah, inputan apabila design telah selesai dibuat, apabila design belum dibuat, tidak diinput kedalam tabel barang,

* maksud dari approv_1 adalah pihak pertama yang berhak mengapprove, approv_2 adalah pihak kedua yang menggapprove barang yang telah diinput,
* jika -1 berarti sudah approve, jika 0 belum approve
* Kondisi clear apabila pihak pertama dan kedua telah mengapprove.

Jika ingin menampilkan isi tabel dengan query normal, maka akan muncul seperti ini (tabel barang tidak disertakan).

no_order | line_no_order | kode_barang | nama_barang | customer
pc001 | 1 | 20C001 | PVC/PVC | pt.abb
pc001 | 2 | 23C002 | XLPE/PVC | pt.abb
pc002 | 1 | 23C002 | XLPE/PVC | pt.toto
pc002 | 2 | 20C000 | XLPE | pt.toto
tc001 | 1 | 24C002 | PVC | pt.gajag tgl.


Bagaimana caranya atau querinya apabila ingin melihat barang yang belum ada / belum diinput di tabel barang / belum approv..


Jika dilihat dari data diatas maka muncul tampilan seperti ini :


no_order | line_no_order | kode_barang | nama_barang | null=not input | approval | customer

pc_001 | 2 | 23C002 | XLPE/PVC | 23C002 | Not Approv | pt.abb
pc_002 | 1 | 23C002 | XLPE/PVC | 23C002 | Not Apprv | pt.toto
pc_002 | 2 | 20C000 | XLPE | 20C000 | Not apprv | pt.toto
tc001 | 1 | 24C002 | PVC | | Not apprv | pt.GT


Ket : tc_001 dalam kolom null=not input tidak terisi karena belum diinput kedalam tabel barang.


bagaimana querynya untuk memuncukan data not approv, sudah saya coba nyampe mabok tapi lum berhasil, tolong bantuanya... Terima Kasih


------------------------------------

SPAM IS PROHIBITEDYahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/belajar-access/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/belajar-access/join
(Yahoo! ID required)

<*> To change settings via email:
belajar-access-digest@yahoogroups.com
belajar-access-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
belajar-access-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

No comments:

Post a Comment