Solved

Select first line of memo field

Posted on 2007-12-06
4
286 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
  • 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 125 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now