On 3/5/08, A. Kretschmer <andreas.kretschmer@xxxxxxxxxxxxxx> wrote: > With generate_series() i generate a list of dates, and later i check if > the date are a saturday. Okay, you need to know sunday -> change from 6 > to 0 and ou course, you can calculate the parameter for the > generate_series like I find it convenient to create a custom version of generate_series: CREATE OR REPLACE FUNCTION generate_series(date,date) RETURNS SETOF date AS $$ SELECT $1 + n FROM generate_series(0,$2-$1) AS x(n) $$ LANGUAGE SQL IMMUTABLE; Regards, Dawid ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org/