Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register
Get Started with Redwood for Oracle Cloud HCM   Begin Now
To ensure that questions get required attention from community members and are NOT left unanswered, it’s important for the author to indicate (by selecting “Yes” or “No” when prompted) whether the question was answered. (newly added) Please note that it is also important to respond to EACH comment your question receives. Your Yes or No response ensures an accurate status for your question.

For more information, please refer to this announcement explaining best practices for getting answers to questions.

BI publisher - How to use conditional statement in SQL query

edited Mar 2, 2017 3:45AM in Reporting and Analytics for HCM 11 comments

Content

We have a payroll report, which accepts startdate and enddate from users.

So there are 3 scenarios this report is generated:

1. Startdate is first of the month and Enddate is 15th of the month

2. Startdate is the 16th of the month and Enddate is the last day of the month

3. Startdate is the 1st of the month and Enddate is the last day of the month

We need to generate report based on one of the above criteria. 3rd one will have 2 sets of reports as it is for the whole month.

Write now we are using 4 sets of query based on each criteria using the UNION operator. This is fine but it is a pain to maintain it. 

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!