IBM Support

Problems with limit retrieved cases (dates) from ODBC query

Troubleshooting


Problem

I am trying to select records from my database based on date in SPSS for Windows. At the "limit retrieved cases" screen in the Database Wizard, I want to only select cases after a certain date, e.g. 7th July 1999. In versions prior to SPSS 15, help (within the "limit retrieved cases" dialog box) states you can use the following: "Date literals should be specified by using the general form: {d yyyy-mm-dd}." I do this and for this date I use {d 1999-07-07} I then go through the rest of the wizard. Whether I click 'OK' on the final screen to import the data or paste the data and run that, I get the following error: >Warning. Command name: GET DATA >SQLExecDirect failed :[Microsoft][ODBC xxxxx Driver] Syntax error (missing operator) in query expression '(date1 > d 1999-07-07} )' or a similar incorrect syntax error depending on my database driver. If I go back to the wizard and put quote marks around my date selection, e.g. {d '1999-07-07'} the data imports with no problems. Is this a mistake in the SPSS documentation?

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF033","label":"Windows"}],"Version":"Not Applicable","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.

Historical Number

61649

Document Information

Modified date:
16 April 2020

UID

swg21479153