Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jchoudja
Starting Member
41 Posts |
Posted - 2013-03-22 : 10:32:16
|
Hi, Hi have tables I will like to combine in 1 table. Table 1HomeAttendancesID__|__ Name___|DateIn___|TimeIn1___|__ John___|03/10/03_|10:10AM2___|__ Ashley_|03/10/03_|09:15AM3___|__ Nina___|03/11/03_|03:10PM4___|__ lisa___|03/15/03_|02:15PMTable 2ExternalAttendancesID__|__Name____|DateIn___|TimeIn1___|__John____|03/15/03_|07:10PM5___|__Bill____|03/20/03_|05:25PM6___|__Joe_____|03/18/03_|03:20PM7___|__Passi___|03/15/03_|01:10PMFrom those 2 tables, I wan to get this:TotalAttendancesID__|__Name___|_DateIn___|TimeIn1___|__John___|_03/10/03_|10:10AM1___|__John___|_03/15/03_|07:10PM2___|__Ashley_|_03/10/03_|09:15AM3___|__Nina___|_03/11/03_|03:10PM4___|__Lisa___|_03/15/03_|02:15PM5___|__Bill___|_03/20/03_|05:25PM6___|__Joe____|_03/18/03_|03:20PM7___|__Passi__|_03/15/03_|01:10PMThank you |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-03-22 : 11:12:24
|
[code]SELECT ID, Name, DateIn, TimeIn FROM Table1UNION ALLSELECT ID, Name, DateIn, TimeIn From Table2ORDER BY ID, DateIn,TimeIn;[/code] |
|
|
jchoudja
Starting Member
41 Posts |
Posted - 2013-03-25 : 10:39:30
|
Thank youjc |
|
|
|
|
|