Weekends between - Mailing list pgsql-novice

From Luiz Eduardo Cantanhede Neri
Subject Weekends between
Date
Msg-id 252e1f290907300740s22e1d2ffle858304152bb2a2f@mail.gmail.com
Whole thread Raw
Responses Re: Weekends between  (Serge Fonville <serge.fonville@gmail.com>)
List pgsql-novice
Hi guys,

I'm trying to find out how many weekends there's between 2 dates and Googling I found this algorithm from
http://archives.postgresql.org/pgsql-sql/2002-06/msg00304.php
date := now - day_of_the_week
> interval := interval + day_of_the_week
> date := date + int( interval/5)x7 + ( interval mod 5)


Assuming that now is current datetime, what I should expect from a date - int? or some1 could explain it better please?

pgsql-novice by date:

Previous
From: Andreas Wenk
Date:
Subject: Re: trouble with connection
Next
From: Serge Fonville
Date:
Subject: Re: Weekends between