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.
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
16 April 2020
UID
swg21994911