IBM Support

Wrong result when selecting a Date difference from Oracle with SPSS Statistics

Troubleshooting


Problem

Suppose you want to select a Date_difference between 2 dates from your Data set of an Oracle Database. The result of the same SQL-statement executed with Toad and SPSS Statistics is different Why is this?

Symptom

1. The SQL statement with Toad returns a correct value

CREATE OR REPLACE FORCE VIEW view_name
AS
SELECT
TO_DATE ('03.10.2016') - TO_DATE ('17.06.2002') date_diff_name,
TRUNC (SYSDATE) - TO_DATE ('17.06.2002') date_diff_new_name
FROM DUAL;

2. Executing the SQL statement in SPSS Statistics returns a "wrong" result

GET DATA
/TYPE = ODBC
/CONNECT = 'DSN=xxxx;UID=xxxx;PWD=passord;SRVR=xxxx'
/SQL =
' SELECT '
' TO_DATE (''03.10.2016'') - TO_DATE (''17.06.2002'') date_diff_name, '
' TRUNC (SYSDATE) - TO_DATE (''17.06.2002'') date_diff_new_name '
' FROM DUAL '
.

CACHE.
EXECUTE.
DATASET NAME DataSet1 WINDOW = FRONT.

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Statistics Desktop","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"22.0;23.0;24.0","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
16 April 2020

UID

swg21994911