?
Solved

Select first line of memo field

Posted on 2007-12-06
4
Medium Priority
?
345 Views
Last Modified: 2013-11-27
I am looking for a way to select only the first line of memo field, quite self explanatory but this is what I am after.

This is the first line
This is the second line
This is the third line

So I would just end up with

This is the first line

Thanks
0
Comment
Question by:daverichardson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 26

Expert Comment

by:jerryb30
ID: 20422488
Select left(memofield, instr(memofield, vbCRLF) as firstLine from yourTable
0
 

Author Comment

by:daverichardson
ID: 20422830
i cant get it to work using vbCRLF, it asks me for the vbCRLF value. If i use the following it puts a carriage return at the end of the line.

SELECT Left([Data]![Description],InStr([Data]![Description],Chr(13) & Chr(10))) AS _Description
FROM Data;
0
 
LVL 26

Accepted Solution

by:
jerryb30 earned 500 total points
ID: 20422857
OK. SELECT Left([Data]![Description],InStr([Data]![Description],Chr(13) & Chr(10))-1) AS _Description
FROM Data;
0
 

Author Closing Comment

by:daverichardson
ID: 31413237
Thanks, i also got it to work with:
SELECT Left([Data]![Description],InStr([Data]![Description],Chr(10))) AS _Description
FROM Data;
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question