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 |
|
pnasz
Posting Yak Master
101 Posts |
Posted - 2010-10-30 : 06:35:30
|
| I have two table one is EmpTimeschedule and another is AttresultEmpTimeSchedule has following fieldsempnofname ndcodefinfoutthcodefin1fin2attresult has following fieldsEmpnoentrydatemfirstinmfirstoutweekdaynameempinempouti want to select fin, fout from EmpTimeSchedule and update the empin,empout of attresult if weekdayname is all day except thursdayif weekdayname is thursday i want to select fin1 and fin2 from Emptimeschedule and update empin,empout of attresultplease help me |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-10-30 : 09:33:29
|
| update attresultset empin = case when weekdayname = 'Thursday' then t2.fin2 esle t2.fin end , empout = case when weekdayname = 'Thursday' then t2.fout2 esle t2.fout end ,from attresult t1join EmpTimeSchedule t2on t1.empno = t2.empno....==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|