[Tutor] date of 1900.01.01 in sql table

janos.juhasz@VELUX.com janos.juhasz@VELUX.com
Mon Feb 3 06:18:01 2003


Dear gurus,

a found that:
*******
import odbc
import dbi

odbc.odbc('an mssql system dsn')
cr =3D db.cursor()
cr.execute('select * from anytable')
data =3D cr.fetchall()
*******
gives me a kind of wrong result when fetch a date, that can be seen as
1900.01.01 in the sqlquery.

I have got
PythonWin 2.2.1 (#34, Apr 15 2002, 09:51:39) [MSC 32 bit (Intel)] on wi=
n32.
Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) -=
 see
'Help/About PythonWin' for further copyright information.
on my MS W2K.

It is a problem with ADO too
*****************
>>> int(rs.fields[8].value)
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
ValueError: illegal time value
*****************
So I can't covert it into int, so I can't convert it into date.


Where can I start to solve it?
May I use try statement to convert it and give back 1900.01.01 at
exception?

Best regards,
-----------------------
Juh=E1sz J=E1nos
IT department
=