0
Create Table #tempTbl
(
[AssID] [int],
[dt] [datetime]
)
insert into #tempTbl
select distinct(AssignmentID), (case when isdate(substring(NoteText,len('Vehicle picked-up was completed on')+1,len(NoteText)))=1 then
substring(NoteText,len('Vehicle picked-up was completed on')+1,len(NoteText)) else '01/01/1900' end) as dop
from dbo.Assignment_Notes
where
AssignmentID in(Select AssignmentID from dbo.Assignment_ClaimInfo
where InsuranceComp='Access General')
and
AssignmentID in (Select AssignmentID from dbo.Assignment_BuyerInfo where PickupDate is null)
and
NoteTypeID=5
update dbo.Assignment_BuyerInfo
set PickupDate=#tempTbl.dt
where AssignmentID=#tempTbl.AssID
請用合適的方式編寫代碼... – anishMarokey 2010-01-14 12:48:51
請發佈您也收到的錯誤消息。 – Doogie 2010-01-14 12:51:05
請編輯您的問題並添加一些有關確切問題的信息。您是否收到錯誤消息,或者INSERT或UPDATE無法正常工作? – DOK 2010-01-14 12:52:01