Re: [SQL] Dates and NULL's`

2011-05-10 Thread Lew
On 05/10/2011 12:48 PM, John Fabiani wrote: Hi, Maybe this is a dumb question but if I have a date field that contains a NULL will it show up when I ask for a where date range for the same date field. Where mydate>= "2011/04/01"::date and mydate<= "2011/04/30"::date With the above where will th

Re: [SQL] Dates and NULL's`

2011-05-10 Thread Theodore Petrosky
rom: Brent Dombrowski > Subject: Re: [SQL] Dates and NULL's` > To: "John Fabiani" > Cc: pgsql-sql@postgresql.org > Date: Tuesday, May 10, 2011, 4:33 PM > On May 10, 2011, at 9:48 AM, John > Fabiani wrote: > > > Hi, > > Maybe this is a dumb questio

Re: [SQL] Dates and NULL's`

2011-05-10 Thread Emi Lu
Where mydate>= "2011/04/01"::date and mydate<= "2011/04/30"::date With the above where will the NULL's be selected Here is what I get when I try: spi=> SELECT NULL::DATE>= '2011-04-01'::DATE AND NULL::DATE<= '2011-04-30'::DATE; ?column? -- (1 row) spi=> SELECT (NULL::DATE>=

Re: [SQL] Dates and NULL's`

2011-05-10 Thread Brent Dombrowski
On May 10, 2011, at 9:48 AM, John Fabiani wrote: > Hi, > Maybe this is a dumb question but if I have a date field that contains a NULL > will it show up when I ask for a where date range for the same date field. > > Where mydate >= "2011/04/01"::date and mydate<= "2011/04/30"::date > > With the

Re: [SQL] Dates and NULL's`

2011-05-10 Thread Emi Lu
if I have a date field that contains a NULL will it show up when I ask for a where date range for the same date field. Where mydate>= "2011/04/01"::date and mydate<= "2011/04/30"::date With the above where will the NULL's be selected I ask because I was always told that a NULL matches every

Re: [SQL] Dates and NULL's`

2011-05-10 Thread John Fabiani
On Tuesday, May 10, 2011 10:30:58 am Richard Broersma wrote: > On Tue, May 10, 2011 at 10:24 AM, John Fabiani wrote: > >> spi=> SELECT NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <= > >> '2011-04-30'::DATE; > >> ?column? > >> -- > >> > >> (1 row) > > > > It looks like you are saying

Re: [SQL] Dates and NULL's`

2011-05-10 Thread Richard Broersma
On Tue, May 10, 2011 at 10:24 AM, John Fabiani wrote: >> spi=> SELECT NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <= >> '2011-04-30'::DATE; >>  ?column? >> -- >> >> (1 row) > It looks like you are saying the NULLS will be returned too The WHERE clause will only return rows is the ar

Re: [SQL] Dates and NULL's`

2011-05-10 Thread John Fabiani
On Tuesday, May 10, 2011 10:16:21 am Richard Broersma wrote: > On Tue, May 10, 2011 at 9:48 AM, John Fabiani wrote: > > Where mydate >= "2011/04/01"::date and mydate<= "2011/04/30"::date > > With the above where will the NULL's be selected > > Here is what I get when I try: > > spi=> SELECT

Re: [SQL] Dates and NULL's`

2011-05-10 Thread Richard Broersma
On Tue, May 10, 2011 at 9:48 AM, John Fabiani wrote: > Where mydate >= "2011/04/01"::date and mydate<= "2011/04/30"::date > With the above where will the NULL's be selected Here is what I get when I try: spi=> SELECT NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <= '2011-04-30'::DATE; ?

[SQL] Dates and NULL's`

2011-05-10 Thread John Fabiani
Hi, Maybe this is a dumb question but if I have a date field that contains a NULL will it show up when I ask for a where date range for the same date field. Where mydate >= "2011/04/01"::date and mydate<= "2011/04/30"::date With the above where will the NULL's be selected I ask because I wa