Phlex
Phlex

Reputation: 441

Update date within a table, Postgresql

So I'm having trouble understanding on how to change the date on an update in postgres. What I have currently, that is giving a syntax error is

UPDATE works_locations SET (wrl_startdate = '2014-09-07', wrl_enddate = '2015-02-06') 

with a few statements determining which field I should specifically change. However, postgres is giving me an error. How do I successfully change the date in postgres, even if the start date is around two years prior to this entry?

Upvotes: 16

Views: 52049

Answers (1)

gmarintes
gmarintes

Reputation: 1308

I don't have Postgres installed so I can't test this but try removing the parenthesis on your SET clause so that it looks like this:

UPDATE works_locations SET wrl_startdate = '2014-09-07', wrl_enddate = '2015-02-06'

Upvotes: 26

Related Questions