my $ sth = $ dbh-> prepare ( SELECT val from table where DD_MM_YYYY = '2012-07-22 00:00:00 ');