devxlogo

November 30, 1999

Forcing a Linefeed in SQL

Question: How do I force a linefeed character using SQL? I created a report (see below) but when I e-mailed this report from Unix the carriage return was not interpreted

Truncating the Last Five Characters in a Field

Question: How do I truncate the last five characters in a field? (The string length varies from row to row.) Answer: Try something along these lines: select left(myfield, datalength(myfield)-5)

Insert Trigger on Parent Table

Question: I have two tables and both tables have a one-to-many relationship. I want to add a new single record in the first “transheader” table (key is autonumber) and get

SQL Using Like to Search for

Question: I have created a database of journal articles and want to offer users the ability to search the Author field for the surnames of authors. Most of the articles