Calculate next event date based on instance of the day of week - Mailing list pgsql-sql

From Dimitri
Subject Calculate next event date based on instance of the day of week
Date
Msg-id AANLkTinmnh-keYONR6y+9g5k3a3BSMDTXH-mB2mjGO8T@mail.gmail.com
Whole thread Raw
Responses Re: Calculate next event date based on instance of the day of week
List pgsql-sql
I'm sure the subject sounds extremely confusing :)

I have a table which stores an event date.  The event is stored as a standard mm/dd/yy entry.

I then need to calculate based on the dd value, WHICH day of the week that is (e.g. Wednesday) and which occurrence of that day of the week, within the month, it is (e.g. the THIRD Wednesday).

From there, I need to calculate, based on the previously obtained information, the mm/dd/yy DATE of next month's third Wednesday.

My business analyst has attempted a few various solutions but we seem to keep missing the mark, we've found tons of information for how to do it in a MySQL or MSSQL instance, but none on Postgres, or at least, none that have worked.

Any help would be appreciated, thanks!

pgsql-sql by date:

Previous
From: Jasen Betts
Date:
Subject: Re: DELETE WHERE EXISTS unexpected results
Next
From: Humair Mohammed
Date:
Subject: COPY with FORMAT in Postgresql 9.x