Eugene,

> create table test(a int, b datetime);
> insert into test values(1,'2004/1/3');
> select * from test where date(b)='2004/1/3'

> The SELECT statement returns no record.

But this works:

sqlite> select * from test where b='2004/1/3';
1|2004/1/3

The date is not encoded properly in the database. Look again at the
date formats shown on the web page.

> Similarly, the statement:
> select date(b) from test
> does not return anything either.

> Perhaps I misunderstood the usage of those functions?

Here's an example...

sqlite> insert into test values (2,datetime("now","localtime"));
sqlite> select * from test where date(b) = "2004-01-03";
2|2004-01-03 22:28:56
sqlite>

e


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to