Please help me at a query !!!

  • Thread starter Thread starter giannis
  • Start date Start date
G

giannis

I have the a table "Table1" with memo field "p".
Can you write a query so update the symbol "#"
with the chr(13) inside the memos? (in SQL form)
I am new in SQL and i want this for a example.
 
I want send with program(queries or vb) carriage returns
in a memo field records.
I used chr(13) (or 10) but i see only smalls rectangles!!!
How can send carriage returns ?!!!

Douglas J. Steele said:
What version of Access?

For Access 2002, you should be able to use:

UPDATE Table1 SET p = Replace([p], "#", Chr(13))

For Access 2000, Replace doesn't always work correctly in SQL, and you have
to write your own wrapper function which uses Replace, like:

Function MyReplace(StringToSearch As Variant, _
StringToSearchFor As String, _
StringToReplaceWith As String) As String

MyReplace = Replace(StringToSearch, _
StringToSearchFor, _
StringToReplaceWith)

End Function

then use

UPDATE Table1 SET p = MyReplace([p], "#", Chr(13))

For Access 97 or earlier, you'll have to write your own Replace function.
One possibility is to copy the code from
http://www.mvps.org/access/strings/str0004.htm at "The Access Web", in which
case you'd then use

UPDATE Table1 SET p = FindAndReplace([p], "#", Chr(13))



--
Doug Steele, Microsoft Access MVP



giannis said:
I have the a table "Table1" with memo field "p".
Can you write a query so update the symbol "#"
with the chr(13) inside the memos? (in SQL form)
I am new in SQL and i want this for a example.
 
Back
Top