If the activationtimestamp field is in YYYYMMDDHHMMSS format have you tried using unix_timestamp? ... select * from SoutheastDB.SubscriptionVersion where unix_timestamp(activationtimestamp) > unix_timestamp(DATE_ADD('20040618070000', INTERVAL 5 HOUR)) and activationtimestamp <= '20040619065959' limit 1;
-----Original Message----- From: Cao, Wenhong To: [EMAIL PROTECTED] Sent: 6/17/04 1:52 PM Subject: Ask again about comparing cast string to date I am trying to select the records where the field activationtimestamp is within a certain range. Unfortunately the field activationtimestamp is defined as character(14) in the table. mysql> select * from SoutheastDB.SubscriptionVersion where date(activationtimestamp) > DATE_ADD('20040618070000', INTERVAL 5 HOUR) and activationtimestamp <= '20040619065959' limit 1; ERROR 1064: You have an error in your SQL syntax near '(activationtimestamp) > DATE_ADD('20040618070000', INTERVAL 5 HOUR) and activati' at line 1 Thanks, Wen -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]