Subject Re: Help with SQL query
Author Pasha Menchshikov
Hello,

b> The two tables I am querying are Contractors and Cont_Jobs and the
b> result that I want is a list of contractors who would be available
b> between the two passed parameters 'jobstart' and 'jobend' (ie.
b> those that are not already allocated a job in the period between
b> 'jobstart' and 'jobend'). ContractorID is primary key in
b> Contractors table and foreign key in Cont_Jobs table. JobStart is a
b> TimeStamp field in the Cont_Jobs table - so the parameters I am
b> passing are DateTime.

If you want use left join here, try the following:
b> select C.Firstname || ' ' || C.Lastname as Contractor, C.ContractorID
b> from Contractors C left join Cont_Jobs J on C.ContractorID =
b> J.ContractorID
where J.JobStart not between :jobstart and :jobend or
J.JobStart is null /* that means there are no corresponding records
in J at all */

HTH

--
Best regards,
Pavel Menshchikov
http://www.ls-software.com