[Migrated content. Thread originally posted on 14 December 2007]
I am using ODBC to transfer vision data to a SQL data base for reporting. I have been trying to use the SUBSTRING command as a part of a WHERE clause to filter the data I need below is the query I am usingSELECT OI_ACCT, OI_PAT, OI_TRIP, OI_TYPE, OI_SEQ,
OI_STATCD, OI_TTYP, OI_TRX_TYPE,
OI_AMOUNT, OI_INS_KEY, OI_CHECK,
OI_TRX_DATE, OI_BATCH, OI_PRI_BILL_TO,
OI_USER, OI_PRI_DATE, OI_POSTED_DATE,
OI_CHG_BILL_INFO, OI_CONTRACT,
OI_REV_STAT, EST_CONTR
FROM AMOPI
INNER JOIN AMAHCHNG
ON (OI_ACCT = SUBSTRING(ACH_FILE_KEY,1,9) )
WHERE
(AHC_FILE_NAME = 'AMOPI') AND
(OI_TRX_TYPE <> 'T')
When I test the query in SQl Server it works but when I run the SSIS package to start the transfer it faild on the ACuODBC piece and I get an error saying extra token and it points to the "(" in the statement.
Is there something wron with my query or does the AcuODBC piece not support the substring statement.
Thanks in advance for any help



