Solved

Select first line of memo field

Posted on 2007-12-06
4
282 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

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…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

757 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

18 Experts available now in Live!

Get 1:1 Help Now