|
-
Nov 15th, 2006, 06:44 AM
#1
Thread Starter
Member
how to select multirecord and insert as a single record?
Friends,
I have two tables.
Table1:
tablename: timetable
Fields: empid
logdate
logtime
inout
here is the record of the above table.
EmployeeID LogDate LogTime InOut
1675 01/03/2006 06:39:16 0
1675 01/03/2006 20:07:48 1
2343 01/03/2006 08:30:16 0
2343 01/03/2006 18:07:48 1
Table2:
tablename: Empdetails
Fields: empid
empname
here is the record of the above table.
EmployeeID Empname
1675 abc
2343 dgfdfg
Now i want to combine the above two tables and insert into a new table.
the new tables field will be.
Empid Empname logdate timein timeout
1675 abc 01/03/2006 06:39:16 20:07:48
2343 dgfdfg 01/03/2006 08:30:16 18:07:48
how can i get the output like the third table from the top 2 tables?
Thanks
Sathyguy
Last edited by sathyguy; Nov 15th, 2006 at 06:55 AM.
-
Nov 15th, 2006, 06:49 AM
#2
Fanatic Member
Re: how to select multirecord and insert as a single record?
IMO: you should be able to select your table records using the SQL JOIN function
-
Nov 15th, 2006, 06:53 AM
#3
Hyperactive Member
Re: how to select multirecord and insert as a single record?
What database system are you using?
-
Nov 15th, 2006, 06:56 AM
#4
Thread Starter
Member
Re: how to select multirecord and insert as a single record?
ms-access database.
could you please provide the code?
-
Nov 15th, 2006, 07:03 AM
#5
Hyperactive Member
Re: how to select multirecord and insert as a single record?
I think that modpluz is right. I would use a create table with a join clause. Something like this:
create table new
select timetable.*, empdetails.* from timetable
inner join empdetails on timetable.empid = empdetails.empid
where insert any criteria here
That should work for ya
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|