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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 data from one table to another

Author  Topic 

pnasz
Posting Yak Master

101 Posts

Posted - 2010-10-26 : 08:50:50
I have a table test1 with folowing fields

empno| ND_Code first_in first_out TH_Code first_in1 first_out1
0134 9 8.00 18.00 0 0.00 0.00


i have another table test2 with

empno | Date |macin | macout | empin | empout

0314 | 10/10/2010 | 08:30 | 15:30



i want to insert into this table (test2) first_in and first_out from test1 table for (empin and empout) if day is sat-wed otherwise i want to insert
firstin1 and firstout1 from test1 table into (empin and empout) of test2

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-10-27 : 04:15:14
Hint :

where datename(weekday,getdate()) in ('saturday','sunday','monday','tuesday','wednesday')

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -