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
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
Re: how to select multirecord and insert as a single record?
What database system are you using?
Re: how to select multirecord and insert as a single record?
ms-access database.
could you please provide the code?
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