SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 42491: A WHERE clause containing the DATEPART() function might be incorrectly formed when passed to Teradata with SAS/ACCESS® Interface to Teradata

DetailsHotfixAboutRate It

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

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to Teradataz/OS9.2 TS2M3
Microsoft® Windows® for x649.2 TS2M3
Microsoft Windows Server 2003 Datacenter Edition9.2 TS2M3
Microsoft Windows Server 2003 Enterprise Edition9.2 TS2M3
Microsoft Windows Server 2003 Standard Edition9.2 TS2M3
Microsoft Windows Server 2003 for x649.2 TS2M3
Microsoft Windows Server 20089.2 TS2M3
Microsoft Windows Server 2008 for x649.2 TS2M3
Microsoft Windows XP Professional9.2 TS2M3
Windows 7 Enterprise 32 bit9.2 TS2M3
Windows 7 Enterprise x649.2 TS2M3
Windows 7 Home Premium 32 bit9.2 TS2M3
Windows 7 Home Premium x649.2 TS2M3
Windows 7 Professional 32 bit9.2 TS2M3
Windows 7 Professional x649.2 TS2M3
Windows 7 Ultimate 32 bit9.2 TS2M3
Windows 7 Ultimate x649.2 TS2M3
Windows Vista9.2 TS2M3
Windows Vista for x649.2 TS2M3
64-bit Enabled AIX9.2 TS2M3
64-bit Enabled HP-UX9.2 TS2M3
64-bit Enabled Solaris9.2 TS2M3
HP-UX IPF9.2 TS2M3
Linux9.2 TS2M3
Linux for x649.2 TS2M3
Solaris for x649.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.