dbTalk Databases Forums  

Substring gets ADO error

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Substring gets ADO error in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TACIR
 
Posts: n/a

Default Substring gets ADO error - 04-12-2005 , 02:32 PM






My DTS package has an SQL statement to select data from an Access database
table. Adding the substring to the SLQ causes "ADO error: ." to be
displayed. The SQL runs ok without the substring. I have tried putting the
substring inside a Cast statement and that did not work either.
DISTRICT_NUMBER is a Text column with a length of 5 in the Access database.
However, the content is numeric. I tried to CAST the column as CHAR 5 and
got the same error.
SELECT ? AS invt_fy, BU_ID, substring(DISTRICT_NUMBER,3,3) as
District_Number, DISTRICTNAME, MAX(OP_BEGIN_DATE) AS op_begin_date
FROM TACIRBaseSchoolData
WHERE (REGION_DESCRIPTION <> 'Scott Test')
GROUP BY 1, BU_ID, DISTRICT_NUMBER, DISTRICTNAME
Any suggestions?

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Substring gets ADO error - 04-12-2005 , 02:50 PM






Does MS Access have SUBSTRING()? I thought they had MID()



"TACIR" <TACIR (AT) discussions (DOT) microsoft.com> wrote


Quote:
My DTS package has an SQL statement to select data from an Access database
table. Adding the substring to the SLQ causes "ADO error: ." to be
displayed. The SQL runs ok without the substring. I have tried putting the
substring inside a Cast statement and that did not work either.
DISTRICT_NUMBER is a Text column with a length of 5 in the Access database.
However, the content is numeric. I tried to CAST the column as CHAR 5 and
got the same error.
SELECT ? AS invt_fy, BU_ID, substring(DISTRICT_NUMBER,3,3) as
District_Number, DISTRICTNAME, MAX(OP_BEGIN_DATE) AS op_begin_date
FROM TACIRBaseSchoolData
WHERE (REGION_DESCRIPTION <> 'Scott Test')
GROUP BY 1, BU_ID, DISTRICT_NUMBER, DISTRICTNAME
Any suggestions?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.