Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Text problem

Status
Not open for further replies.

tonyweis138

Programmer
Jul 27, 2007
8
US
I have a customer that is scanning in a value (ex. 12345.00) that needs to be matched to a value in a text file to return a row.

However, the key value in the row would be 12345 without the '.00'. My problem is how to strip off that last few characters in the string.

If i was doing it with sql server i could do something like:

select * from table where KeyField = substring(value, 0,charindex('.',value))

But with the limited statements available with the MS ODBC text driver, i am not sure how to do it. Any ideas?
 
It isn't listed, but it gives me errors stating that those are unrecognized commands.
 
Awesome, that is half the battle. Now i just need to find a function to find the position of the '.' in the string in order to know where it should be split. That Mid() works great, though.
 
That might be LOCATE(), which is the function listed in the ODBC 2.0 specification. (Of course, the specification also lists SUBSTRING()).

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top