On Mon, 2002-04-15 at 12:45, Bill McClintock wrote: > Not sure if this is the write place to ask but here we go. > > I need to find a way to get date fields in a database to be returned in > the same formatting. I have an MSSQL database but the end clients are > linux w/ DBD::Sybase (FreeTDS build) and WinNT w/ DBD::ODBC. > > DBD::Sybase returns dates like...'Apr 15 2002 12:00AM' > DBD::ODBC returns dates like...'2002-04-15 00:00:00.000' > > I know w/ DBD::Oracle I can use an 'alter session' statement to specify > how I want dates. Is there either a way for DBI in general or specifics > for DBD::Sybase and DBD::ODBC to change default date formats?
A few things can be done with DBD::Sybase, but I don't know if they are supported by FreeTDS yet. See the _date_fmt() $dbh->func() function - it can be used to set the client date format using the Sybase API (Sybase formats the dates in the client). You can also use the convert() SQL built-in in your query, but that won't be transparent, of course. Michael -- Michael Peppler Data Migrations, Inc. [EMAIL PROTECTED] *or* [EMAIL PROTECTED] http://www.mbay.net/~mpeppler International Sybase User Group: http://www.isug.com
