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 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy