generate_series that's a good one!
Thank you!
On 7/3/07, Emi Lu <[EMAIL PROTECTED]> wrote:
Can I know how to get the date of each month's last Thursday please?
Query: select getDateBaseOnWeekday('2007-04-01', 'Last Thursday');
Result: 2007-04-26
you can easily do it without functions.
fo
On 7/3/07, Emi Lu <[EMAIL PROTECTED]> wrote:
Can I know how to get the date of each month's last Thursday please?
Query: select getDateBaseOnWeekday('2007-04-01', 'Last Thursday');
Result: 2007-04-26
you can easily do it without functions.
for example, this select:
SELECT
cast(d.date + i
On Jul 3, 2007, at 14:54 , Emi Lu wrote:
result := (
(date_part('year', $1) || '-' || date_part('month',
$1) || '-01')::date
+ '1 month'::interval - '1 day'::interval
)::date;
I recommend not using string manipulation to handle data that i
Emi Lu wrote:
Hello,
Can I know how to get the date of each month's last Thursday please?
For example, something like
Query: select getDateBaseOnWeekday('2007-04-01', 'Last Thursday');
Result: 2007-04-26
Thank you!
It turns out my original solution was slightly (badly) wrong and was
retu
Thank you all for your inputs!
Based on your inputs, made it a bit change to my application:
==
DROP FUNCTION test_db.lastWeekdayDate (date, varchar) ;
CREATE OR REPLACE FUNCTION test_db.lastWeekdayDate (dat
On Jul 3, 2007, at 13:27 , Emi Lu wrote:
Can I know how to get the date of each month's last Thursday please?
For example, something like
Query: select getDateBaseOnWeekday('2007-04-01', 'Last Thursday');
Result: 2007-04-26
Using a function for calculating the first occurrence of a particu
Emi Lu wrote:
Hello,
Can I know how to get the date of each month's last Thursday please?
For example, something like
Query: select getDateBaseOnWeekday('2007-04-01', 'Last Thursday');
Result: 2007-04-26
Thank you!
CREATE OR REPLACE FUNCTION lastday (date,int) RETURNS DATE AS '
DECLARE
am Tue, dem 03.07.2007, um 14:27:24 -0400 mailte Emi Lu folgendes:
> Hello,
>
> Can I know how to get the date of each month's last Thursday please?
>
> For example, something like
>
> Query: select getDateBaseOnWeekday('2007-04-01', 'Last Thursday');
> Result: 2007-04-26
Write you own functi
Hello,
Can I know how to get the date of each month's last Thursday please?
For example, something like
Query: select getDateBaseOnWeekday('2007-04-01', 'Last Thursday');
Result: 2007-04-26
Thank you!
---(end of broadcast)---
TIP 1: if posting/