I have a numeric field which consists of seven digits which sometimes has an appending "/" and one more number which indicates a page number. I have a character replacement rule to strip out the "/". Do you know how I can truncate the field to ignore the "/" and any subsequent digit? I tried a regular expression for the seven digits. Would I just create a script for this and do it that way?
Truncate the length of a field
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています
コメント
7件のコメント
http://bytes.com/topic/asp-classic/answers/526885-truncate-string-vbscript
**Removing everything from the "?" on**
MyString = Left(MyString,number)
So based on this the following would work.
MyString = "http://www.frogs.com?place=egypt"
number = Instr(MyString,"?") - 1
MyString = Left(Mystring,number)
MyString now equals http://www.frogs.com
Hi Everyone, can anyone help with a matter of getting my export fields inexplicably truncating beyond my understanding. In the database I have a column defined to hold nvarchar of length of 30 on FlexiCapture test the characters from the element are all showing they are also all showing when exporting to a data file but truncate when directed to SQL Server export. Any clues anyone??
Harti,
It might be better if you create a new topic next time because this isn't related to the original topic. If the fields in FlexiCapture are showing correct but during the export the fields are cut off in the DB, more than likely, your issue could be your providers and drivers for the DB. Please refer to the help file for the correct driver. i.e. for SQL Server they recommend "OLE DB Provider for ODBC drivers"
Thanks Sushi
I will review that as a probable solution and test solution.
Hi Shushi, we tried to resolve the matter by following your instructions but still the same result truncation is occurring. Ran a script to trace the truncation on SQL Server but the leak was not found on SQL Server. Have been in touch with Microsoft people waiting on their feedback.
What you can do is also export to a file first. If the value is truncated there, then its some issue with your FlexiCapture project setting. If it is not truncated there, then it could be the DB setting or the connection. To test out the second part, export to some other ODBC DB like MS access and see if it truncated there. If not, it's your DB setting.
サインインしてコメントを残してください。