Results 1 to 5 of 5

Thread: how to select multirecord and insert as a single record?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2005
    Posts
    57

    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.

  2. #2
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    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
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  3. #3
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    Re: how to select multirecord and insert as a single record?

    What database system are you using?

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2005
    Posts
    57

    Re: how to select multirecord and insert as a single record?

    ms-access database.
    could you please provide the code?

  5. #5
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    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
  •  



Click Here to Expand Forum to Full Width