473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Splitting a text field conatining a carriage return.

I have a field in an access 2000 database that is actually three lines
of text separated by carriage returns.

Is there a function in the Access version of SQL that will let me
locate the carriage returns and then split the field based on the
positions of the carriage returns?

Or do I need to process the field with Visual Basic?

I seached for an answer to this on the web. I found an answer that
said to use the CHARINDEX function but that is apparently not a part
of ACCESS 2000 because I get an error message saying that it is
invalid.

Thanks in advance for your help.

Greg Teets
Cincinnati Ohio USA
Nov 13 '05 #1
1 11755
On Thu, 30 Dec 2004 20:06:19 GMT, Greg Teets wrote:
I have a field in an access 2000 database that is actually three lines
of text separated by carriage returns.

Is there a function in the Access version of SQL that will let me
locate the carriage returns and then split the field based on the
positions of the carriage returns?

Or do I need to process the field with Visual Basic?

I seached for an answer to this on the web. I found an answer that
said to use the CHARINDEX function but that is apparently not a part
of ACCESS 2000 because I get an error message saying that it is
invalid.

Thanks in advance for your help.

Greg Teets
Cincinnati Ohio USA


If your version of Access has the Split() function (look it up in VBA
Help), you can use it to parse the field into 3 different parts.
You would use Chr(13) & chr(10) as the field delimiter.

Because this is a VBA function, you'll need to create a module, then
call it from the query.

In a module:

Public Function splitthis(fieldin, X)
Dim var As Variant
var = Split(fieldin, Chr(13) & Chr(10), -1)
splitthis = var(X)

End Function

In a query:
New:splitthis([FieldName],0)

will get the first part. The parts are Zero based, so the third part
will be
splitthis([FieldName],2)

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike | last post by:
In my database there is a text field type that is used to enter street address. This address could be a few lines long, each line with a carriage return at the end. Is there a way to search for...
0
by: raj | last post by:
I have multiline-text box in my C# application. User enter text into the multiline-text box, and without completing the whole line, user press Enter Key and go to the next line, by leaving the...
8
by: Dave Moore | last post by:
I realize this is a somewhat platform specific question, but I think it is still of general enough interest to ask it here ... if I am wrong I guess I will find out 8*). As we all know, DOS uses...
1
by: chrissmith_76_Fed_Up_With_Spam | last post by:
Hello all, I am using Access 2002, with file format of Access 2000, and am experiencing a problem. I have a subform that is shown in datasheet view for users to edit data direct to a table. ...
4
by: whitej77777 | last post by:
I am trying to write a user defined function that will allow me to strip off the last carriage return and line feed from a text field. We have address fields stored in a text field for our ERP...
2
by: iritchie | last post by:
*(Apologies, I posted this in the SQL Server forum first) Hello all, I am trying to write a query which breaks down a single address field into individual fields, with char(10) or a...
1
by: nur123 | last post by:
Thanks in advance who will look at it. I have been encountering an issue which I can’t find a way out of it. What my pgm does: It (java codes) reads oracle table data and creates flat text...
11
by: evenlater | last post by:
My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message...
1
by: jollyroger | last post by:
I have searched the web forums, and can't seem to find an answer to this particular problem I have. In an excel sheet, cells in one column have formatted text in the "wrapped" cells. For many of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.