Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm a system administrator and bask

Status
Not open for further replies.

lier74ok

MIS
Feb 6, 2002
30
MY
I'm a system administrator and basket boss ask me to write a dabase in MS access and i need to write this code. I already try the help using copyobject command but its fail...please help to write this simple code...i need to submit to my boss urgently....please....

table1:field1,field2
table2:field2,field2
table3:field1

i need to copy all data from table1:field1 and table2:field2 to table3:field1. I tried using the copyobject command but its owerite the existing data.i need all data to be in the table for comparison purposes.

I'm from malaysia and i not rich, but i promise to send you a lot of postcard of my beutifull country picture to you.

Please help.Thank you...my increment is depending on this

 
lier74ok
Is this being done from a web page? ASP?

or are you just trying to do this in a access form? [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
All the table in MS access. So i want to write a code in the module section to do this job. Everything in MS Access.
 
table1
------
a 123
b 456
c 789

table2
------
zzz test
xxx hello
yyy wow

Question: are you after
table3
------
atest
bhello
cwow

or are you after
table3
------
a
b
c
test
hello
wow

? codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
<insert witticism here>
 
It ls like this:

Table Name : Monitor
Monitor Code: monitor001,monitor,002
Monitor SN : Monitor Serial Number

Table Name : CPU
CPU Code :cpu001,cpu002,
CPU SN :CPU Serial Number

i want it to be like this

Table Name:combine
Combination:cpu001,cpu002,monitor001,monitor,002


Or i put it this way

Table1:Monitor
Monitor code Monitor SN
001 4569875
002 4569874

Table2:CPU
CPU Code CPU SN
003 4569878
004 45698

I want like this

Table3:COmbine
Combine
001
002
003
004

I hope this clear ...thanx
 
So something like:

insert into combine (combination)
select [monitor code] from monitor group by [monitor code]
union
select [cpu code] from cpu group by [cpu code] codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
<insert witticism here>
 
yes you are correct but how to put it in real sql statement... i tried by guessing somethimg like this

insert combine(combination)
select monitor(monitor code)
union
select cpu(cpu code)

but i got syntax error......any help?
 
Notice in my example above I have the FROM and GROUP BY (or could use DISTINCT) clauses. codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
<insert witticism here>
 
this is the actual code i write:

insert into combine(combination)
select [monitor code] from monitor group by [monitor code]
union
select [cpu code] from cpu group by [cpu code];

This what message i got from bill gates:

syntax error(missing query)in expression &quot; [monitor code]
union
select [cpu code] from cpu group by [cpu code]&quot;.

did i do something wrong....?...now iknow what is union...something like combination...i'll try to look some manual on this....TQ codestorm....you want some post card?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top