Skip to Content.
Sympa Menu

freetds - Error with dates

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Stefan Sonnenberg-Carstens" <s.sonnenberg AT coolspot.de>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Error with dates
  • Date: Tue, 17 Sep 2002 14:26:17 +0200

Hi list,
we have a very strange problem regarding insertions of dates generated by php into an MS SQL Server 2000 SP2 table.
The Software is running debian/unstable with php-4.3.2 and freetds 0.53
 
The script looks like this
<?
 
require_once("common.inc.php");
 
$datetime = date("Y-m-d H:i:s");
$conn = getConnection();
$conn->debug = true;
 
$sqlQuery = " INSERT INTO paymentTransactions "
          . " (LID, insertDate) "
          . " VALUES "
          . " ('1195', getdate()) ";
 
if($conn->Execute($sqlQuery) === false) {
        echo "ERROR!\n";
        exit;
}
 
exit;
 
?>
Sometimes, very strange,this error occurs :
 
Warning: Sybase: Server message: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. (severity 16, procedure N/A) in /usr/local/www/includes/adodb/drivers/adodb-mssql.inc.php on line 332
242: The statement has been terminated.
ERROR!
 
The insertdate field is defined as datetime(8)
 
freetds.conf :
[global]
    version = 7.0
locales.conf
    date fomat = %Y-%m-%d %H:%M:%S
What is wrong ?



Archive powered by MHonArc 2.6.24.

Top of Page