I’m a newbie to Sequel and I’m trying to recreate some old Crystal Reports using Sequel. My question is: how does the IF, Else statement work in Sequel?
This is the statement for Crystal, for a Termination report, we have six companies and if an employee transfers to one of our other companies, we need to indicate the employee as a term/transfer.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 4 &nbspReplies

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

To clarify, it looks as if both of those IF-conditions yield the same THEN-result: { ToText ({PEPTR.TRTRCD})+", "+ToText({PEPTR.TRTEC}) ]. That implies that they could form a single compound IF-condition that connects the two with "OR". After that, there is no indication of what any result should be emitted when neither condition is true.
.
Can you verify if those are correct interpretations of what you wrote?
.
Also, are you asking about the "Sequel" product from HelpSystems (i.e., from ASC.)? Or are you using "Sequel" as a generic term for "SQL"?
.
Tom

Thanks Tom, I have it working now.
We actually use the SEQUEL View Point Software
1.The first statement looks for the transaction code “TE ” and if the Termination code is “VTRNS”
The above is an employee who has transferred from one property to another, so they are terminated from the first property and rehired as a transferred to the second property
2.The second statement looks for the transaction code “TR” and the Termination code can be anything
which indicates the employee is no longer working anywhere within the company.
So, I created a Derived field called PE_ACTION where that holds that information using the following.
CASE
WHEN TRTRCD.peptr='TE ' AND TRTEC.peptr='VTRNS' THEN TRIM(TRTRCD.peptr)||','||(TRTEC.peptr)
WHEN TRTRCD.peptr='TR ' THEN TRTRCD.peptr||TRTEC.peptr
END

I would replace the vertical bars with CONCAT if Sequel accepts it. The use of special characters can cause trouble. And I would add an ELSE clause to ensure that some known value is emitted from the CASE structure when neither condition is true.

.

BTW, your CASE statement doesn't include the embedded comma in the second WHEN clause.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy