Hi Michael,

Thx for your reply.  I do understand SQLite is typeless.
Infact I have already done the YYYY/MM/DD format.

Is that away to have a "DATE" comparison inside SQLite?
Or any expression to convert DATE to integer in SQLite?
I mean, I don;t have to worry about data migration from other
database.

Regards
KL Chin

-----Original Message-----
From:   Michael A. Cleverly [SMTP:[EMAIL PROTECTED]
Sent:   Friday, January 02, 2004 9:55 AM
To:     KL Chin
Cc:     '[EMAIL PROTECTED]'
Subject:        Re: [sqlite] Date problem

On Fri, 2 Jan 2004, KL Chin wrote:

> Can anyone help on this problem, why with the query below
> 
> DELETE FROM ABC WHERE datein < '12/29/03';
> 
> All my record date from '1/1/04' to '1/6/04' were delete.
> Where datein was date type.

SQLite is typeless, see: http://www.sqlite.org/datatypes.html, paying
particular attention to section 3.0 on "comparison and sort order."

As a string, "1/1/04" is less than "12/29/03".  If you store your dates in
YYYY-MM-DD format, they'll sort & compare properly as you would expect.

Michael


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

Reply via email to