Calculate next event date based on instance of the day of week

Поиск
Список
Период
Сортировка
От Dimitri
Тема Calculate next event date based on instance of the day of week
Дата
Msg-id AANLkTinmnh-keYONR6y+9g5k3a3BSMDTXH-mB2mjGO8T@mail.gmail.com
обсуждение исходный текст
Ответы Re: Calculate next event date based on instance of the day of week  (Jayadevan M <Jayadevan.Maymala@ibsplc.com>)
Список 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 по дате отправления:

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: DELETE WHERE EXISTS unexpected results
Следующее
От: Humair Mohammed
Дата:
Сообщение: COPY with FORMAT in Postgresql 9.x