Gilles Ganault <nos...@nospam.com> writes:

>       I have data in an SQL database where one column contains a
> date formated as DD/MM/YYYYY.
> 
> I need to select all rows where the date is before, say Feb 1st
> 2009, ie. 01/02/2009.

The Python data types for date and time are in the ‘datetime’ module
<URL:http://www.python.org/doc/2.6/library/datetime>. Create a
‘datetime’ object for each value you want, then compare them.

To create a ‘datetime’ value from a string, use ‘datetime.strptime’
(new in Python 2.5).

-- 
 \                            “Holy knit one purl two, Batman!” —Robin |
  `\                                                                   |
_o__)                                                                  |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to