I have a sales order with 6 comment lines available to use. I only want to select a sales order if ALL 6 of the comment lines do NOT start with the letter Q. How can I do this in Crystal 8?
Would that it were that easy. In each record in the comment table, there's a field for sales order number, and a field for the comment text. So if there are no comments on a particular order, there are no entries for that sales order in the table. A typical SO has comment, blank line, comment, comment, blank line, comment. The Q comment is in the first line if it's there at all. However, the comment text fields aren't labeled comment1, comment2, etc. So, when my criteria was "socomment does not start with Q", it selected all orders where ANY of the comment lines didn't start with Q, not where ALL of the comment lines (for that SO) didn't start with Q. Thanks.
If this is a large database and you want
to resolve the condition on the server
you could use a SQL query such as:
SELECT ...
FROM SO SO_Alias, COMMENT
WHERE NOT EXIST
(SELECT COMMENT.SO_ID FROM COMMENT WHERE
COMMENT.SO_ID = SO_Alias.SO_ID AND
LEFT(COMMENT.Comment_text, 1) =Q)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.