Andrew Tye
Andrew Tye

Reputation: 25

Increment time only for the given timestamps while retaining the dates

Here is the picture of the table

I want to increment the startTime by 30 minutes without changing the dates.

This is what I tried but it gives me the type mismatch error.

UPDATE Meeting
SET starttime = starttime::time + 30
WHERE purpose = 'Staff';

How can I accomplish this?

Upvotes: 0

Views: 25

Answers (1)

user330315
user330315

Reputation:

Add an interval

UPDATE Meeting
   SET starttime = starttime + interval '30 minutes'
WHERE purpose = 'Staff';

Upvotes: 1

Related Questions