Problem Note 42491: A WHERE clause containing the DATEPART() function might be incorrectly formed when passed to Teradata with SAS/ACCESS® Interface to Teradata
A WHERE clause containing the DATEPART() function might be incorrectly formed when passed to Teradata with the SAS/ACCESS Interface to Teradata software.
The data type of the unformatted date, in the example below, is derived from the column datetime_col used in the DATEPART() function, not the function itself and is therefore formed as a DATETIME constant:
SELECT * from TeraLib.TeraTable WHERE datepart(datetime_col) = 18681;
/* the unformatted date, 23FEB2011, will be passed to Teradata as TIMESTAMP'1960-01-01 05:11:21' */
Use a formatted date literal to circumvent the issue:
SELECT * from TeraLib.TeraTable WHERE datepart(datetime_col) = '23FEB2011'd;
/* the formatted date will be passed to Teradata as DATE'2011-02-23' */
Operating System and Release Information
SAS System | SAS/ACCESS Interface to Teradata | z/OS | 9.2 TS2M3 | |
Microsoft® Windows® for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M3 | |
Microsoft Windows XP Professional | 9.2 TS2M3 | |
Windows 7 Enterprise 32 bit | 9.2 TS2M3 | |
Windows 7 Enterprise x64 | 9.2 TS2M3 | |
Windows 7 Home Premium 32 bit | 9.2 TS2M3 | |
Windows 7 Home Premium x64 | 9.2 TS2M3 | |
Windows 7 Professional 32 bit | 9.2 TS2M3 | |
Windows 7 Professional x64 | 9.2 TS2M3 | |
Windows 7 Ultimate 32 bit | 9.2 TS2M3 | |
Windows 7 Ultimate x64 | 9.2 TS2M3 | |
Windows Vista | 9.2 TS2M3 | |
Windows Vista for x64 | 9.2 TS2M3 | |
64-bit Enabled AIX | 9.2 TS2M3 | |
64-bit Enabled HP-UX | 9.2 TS2M3 | |
64-bit Enabled Solaris | 9.2 TS2M3 | |
HP-UX IPF | 9.2 TS2M3 | |
Linux | 9.2 TS2M3 | |
Linux for x64 | 9.2 TS2M3 | |
Solaris for x64 | 9.2 TS2M3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
The data type of the unformatted date is derived from the column used in the DATEPART() function, not the function itself and is therefore incorrectly formed as a DATETIME constant.
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2011-02-23 12:30:41 |
Date Created: | 2011-02-23 09:45:31 |