/* */

Wednesday, November 3, 2010

Re: [belajar-access] mau tanya update query

mungkin ini bisa membantu, dari arsip milis sebelumnya yang di posting
oleh pak MBA

ada dua langkah pak Johan,

1. chek dulu data yang sama --> update
2. chek data yang tdk ada --> append

contoh.

tContoh
ID Test
1 one
2 two
3 three
4 four

tDataInput
ID Test
1 satu
5 five

query1:
UPDATE tDataInput INNER JOIN tContoh ON tDataInput.ID = tContoh.ID SET
tContoh.Test = [tDataInput].[Test];
query2:
INSERT INTO tContoh ( ID, Test )
SELECT tDataInput.ID, tDataInput.Test
FROM tContoh RIGHT JOIN tDataInput ON tContoh.ID = tDataInput.ID
WHERE (((tContoh.ID) Is Null));
kalo mau gampang dua query ini di masukkan macro.
data di taruh di tDataInput. panggil macro. dua query dieksekusi.

hasilnya:
tContoh
ID Test
1 satu
2 two
3 three
4 four
5 five

salam,
murid access - CL

2010/11/3, Rusmanto <rusmanto@tokatindung.com>:
> Betul sekali Mas Deni, kadang semau field di update tapi kadang juda tidak,
> jadi intinya gimana caranya
> supaya update ke Tabel 1 dari Tabel 2 itu bisa mengganti nilai2 di field
> Tabel 1 baik semua atau hanya sebagaian.
>
> makasih Mas Deni kalau ada caranya kasih tahu neh...... biar saya juga ikut
> belajar.
>
> salam
> Rusman
>
>
> _____
>
> From: Deni Agus [mailto:dr.deniagus@yahoo.co.id]
> To: belajar-access@yahoogroups.com
> Sent: Wed, 03 Nov 2010 06:28:42 +0000
> Subject: Re: [belajar-access] mau tanya update query
>
>
>
>
>
>
> ikutan bertanya ya Mas, kalo gak sama pertanyaannya ya ndak papa!! (biar
> sekaligus dijawab amam pakar"nya access)
>
> Mas rusman, apa 10 record yang mau dimasukkan tadi akan mengganti semua
> field yang ada. (record di update)
>
> misal 1011260 yang mau diganti :
>
> sample_id au1 au2 au3 au4 ag1 hg1 auave agave
> 1011260 3.25 3.32 1.2 0.25 3.285 1.2
>
> menjadi :
>
> sample_id au1 au2 au3 au4 ag1 hg1 auave agave
> 1011260 1,2 1,3 1.4 0,1 2.2 0.2
>
> ato hanya field tertentu.
> maap kalo ikutan nanya, coz masalahnya sama ama yang aku adepin juga.
>
> Trims,
>
>
>
>
>
> *** This e-mail and attachments it might contains has passed internal
> anti-virus check but it is suggested for you to re-scan with your anti-virus
> ***
>
> Disclaimer Notice :
> This message and any attachment contains information intended only for the
> use of the addresee named above. It may also be confidential and/or
> privileged.
> If you are not the intended recipient of this message you are herby notified
> that you must not disseminate, copy or take any action in reliance on it.
> Please delete the message and notify the sender.
> Opinions, conclusions and other information in this message that do not
> relate to the official business of Archipelago Resources Plc., Archipelago
> Resources Pty Ltd.,
> PT Meares Soputan Mining, PT Tambang Tondano Nusajaya shall be understood as
> neither given nor endorsed by them.
>


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

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