Re: date range query help

From: brian <brian(at)zijn-digital(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: date range query help
Date: 2008-11-20 03:28:03
Message-ID: 4924D943.6020005@zijn-digital.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice pgsql-sql

novice wrote:
> 2008/11/20 Adam Rich <adam(dot)r(at)sbcglobal(dot)net>:
>>
>> select call.call_id,
>> call.datetime,
>> mobile_custodian.user_id,
>> call.mobile_no
>> call.charge
>> from call, mobile_custodian
>> where call.mobile_no = mobile_custodian.mobile_no
>> and call.datetime between mobile_custodian.issue_date
>> and mobile_custodian.return_date
>
> sorry I get nothing :(
>

How about:

SELECT call.call_id,
call.datetime,
mobile_custodian.user_id,
call.mobile_no,
call.charge
FROM call
LEFT JOIN mobile_custodian
ON call.mobile_no = mobile_custodian.mobile_no
AND call.datetime
BETWEEN
mobile_custodian.issue_date
AND
mobile_custodian.return_date;

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message novice 2008-11-20 03:43:00 Re: date range query help
Previous Message novice 2008-11-20 03:03:05 Re: date range query help

Browse pgsql-novice by date

  From Date Subject
Next Message novice 2008-11-20 03:43:00 Re: date range query help
Previous Message novice 2008-11-20 03:03:05 Re: date range query help

Browse pgsql-sql by date

  From Date Subject
Next Message novice 2008-11-20 03:43:00 Re: date range query help
Previous Message novice 2008-11-20 03:03:05 Re: date range query help