Problem with complex outer join expression - Mailing list pgsql-general

From Chris Velevitch
Subject Problem with complex outer join expression
Date
Msg-id b0a3bf780604252325s31cbef5fy53053ada1bd1a11e@mail.gmail.com
Whole thread Raw
Responses Re: Problem with complex outer join expression  ("chris smith" <dmagick@gmail.com>)
Re: Problem with complex outer join expression  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I'm using 7.4.5 on win XP Pro SP1.

I'm getting:-

     ERROR:  syntax error at or near "(" at character 155

from the query:-

select dummy_records.sequence_nr,timesheets.weekending,timesheets.timesheet_id
from dummy_records
     ,left outer join timesheets
            on (timesheets.weekending = ('2006-04-09' + (integer
dummy_records.sequence_nr-1)*7)))
where dummy_records.sequence_nr between 1 and (date '2006-04-23' -
date '2006-04-09')/7+1;

What this query is trying to achieve is:-

Find all weekending dates between 2 given weekending dates and any
corresponding timesheets for those weekending dates.

What am I doing wrong here? How do I achieve what I want?


Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re:
Next
From: "chris smith"
Date:
Subject: Re: Problem with complex outer join expression