Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How I can select where a date is null..

Re: How I can select where a date is null..

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 19 Apr 2004 06:47:57 -0700
Message-ID: <1082382467.393875@yasure>


Paola wrote:

> Hi, my problem is the following:
> I have different selection parameters for my query. So, the user can insert
> one or more of these selection fields.
>
> I think that an example can explain you better.
> this is my table:
> TAB1 (
> field1 VARCHAR2(25) NULL,
> filed2 VARCHAR2(25) NULL,
> ...
> DATA1 NUMBER(7) NULL)
>
> (field DATA1 is a date in JULIAN format)
>
> field1 field2 data1
> -----------------------
> A A 2450341
> B BB
>
> My query, supposed that var1 = '%' and var2 = '%') is
>
> SELECT field1 FROM "tab1"
> WHERE ( upper("tab1".field1") like :var1) AND
> ( upper("tab1"."field1") like :var2) AND
> ...
> ( "tab1"."DATA_1" >=
> TO_NUMBER(to_char(TO_DATE(:var_data,'DD/MM/YYYY'),'J')))
>
> This SELECT has no result because DATA1 in the second record is null.
> How can resolve this problem?
>
> Thank in advance!
> Paola

SELECT ...
FROM ...
WHERE ...

UNION ALL
SELECT ...
FROM ...
WHERE ...

or an outer join.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Mon Apr 19 2004 - 08:47:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US