[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Queries on Dates and Indices



Hi,

I'm using 0.92 and I'm having some issues with queries 
on dates.  I have a table called PENLTIES with a column 
called PEN_DATE declared as DATE NOT NULL.  The column 
is populated as follows:

	'1980-12-08'
	'1980-12-08'
	'1980-12-08'
	'1981-05-05'
	'1982-12-30'
	'1983-09-10'
	'1984-11-12'
	'1984-12-08'

Using the JDBC Query Tool, I performed the following 
queries using the above data:

SELECT * FROM PENLTIES WHERE PEN_DATE > '1982-12-30';
I get back all the above eight rows.

SELECT * FROM PENLTIES WHERE PEN_DATE < '1982-12-30';
I get no results

SELECT * FROM PENLTIES WHERE PEN_DATE = '1982-12-30';
I get no results

SELECT * FROM PENLTIES WHERE PEN_DATE >= '1982-12-30';
I get back all the above eight rows.

SELECT * FROM PENLTIES WHERE PEN_DATE <= '1982-12-30';
I get no results

Am I doing something wrong or is this a bug?

Should I be using a different date format?

PEN_DATE was not declared as INDEX_BLIST, should it have 
been?  Are columns indexed by default?

Regards,
Mamading Ceesay

"Don't worry about what anybody else is going to do. 
The best way to predict the future is to invent it."

-- Alan Kay