April 23, 2015 at 1:41 pm
Is it possible to replace a Date Value if null with another date in a table?
Example :
DATEPART(mm, (ISNULL((DATEADD(mm,1,s.Date)),s.Date)))
April 23, 2015 at 1:57 pm
same table? sure:
UPDATE Customer
SET UpdatedDate = CreatedDate
WHERE UpdatedDate IS NULL
AND CreatedDate IS NOT NULL
different table ? if you can join the tables together, then yes.
UPDATE Customer
SET VerifiedDate = Verfications.VerifiedDate
FROM Customer
INNER JOIN Verfications ON Customer.CustomerId = Verfications.CustomerId
WHERE Customer.VerifiedDate IS NULL
AND Verfications.VerifiedDate IS NOT NULL
Lowell
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply