|
-
Jun 14th, 2022, 09:53 AM
#5
Re: Type Conversion Issue
@ Tyson: How does one format a text file in any fashion? While this is a file containing Comma Separated Values (CSV), it is still just a simple text file. I believe that any formatting is done by ADO.
@Wes: I tried that, as well. The column does remain string, but what happens is that ADO takes the field, turns it into a date, then turns the date into a string and puts it in the column. In other words, it does the conversion to a date before it gets to the datatable, so what ends up in the datatable is wrong.
@Zvoni: The field name already has to be in square brackets, even before key words are considered. It annoys the heck out of me, but the folks who supply this data made virtually EVERY column name (field name) a multi word string separated by spaces. That just makes that stuff really awkward, and there's no good reason for it. Still, I have to live with it.
I have brought in the column directly, and that works, so when I get an error with CAST, then all that is different is the CAST. For example, I tried "SELECT [CWT Value]" and that worked, but "SELECT CAST([CWT VALUE] AS varchar)" gives that error, so I'm guessing that CAST itself is the issue.
I have not tried concating with quotes, and that's worth a try.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|