user3408399
user3408399

Reputation: 109

How to update datetime column from a row?

For testing purpose I want to alter a column in a row where SELECT * FROM CSEReduxResponses WHERE response_id=76 The column I want to modify is [approveddate] [datetime] NULL, Is there a way I can change the date? I will like to change it to MARCH 2,2014. Right now is '2014-04-15 09:49:00.000'.

I have:

Microsoft sql server 2008
Microsoft SQL Server Management Studio  10.0.2531.0

Upvotes: 0

Views: 197

Answers (1)

jpw
jpw

Reputation: 44911

Maybe I'm not getting what you want, but it sounds like you want a simple update query? If so, this should do it:

UPDATE CSEReduxResponses 
SET approveddate = '2014-03-02'
WHERE response_id = 76

How the date is displayed depends on your language settings, and can be altered when you issue your query, so if you want March 03, 2014instead of 2014-03-02you can control it in the query.

Upvotes: 1

Related Questions