Toad World® Forums

CASE in TDA


#1

Hello,

Is there a way to do a CASE statement from the Query Builder in TDA? I can’t seem to find any information on doing this, and it would be useful.


#2

You can build a case statement in the calculated fields editor. There is a tool bar button to open the calculated fields editor. In the field definition there is a drop down that opens into an editor where you can put your case statement.

Or if you want, you can send to the SQL editor and build your SQL with the case statement in the SQL Editor and use the reverse engineering button to send back to the Query Builder and it will put into the calc field.

If this doesn’t make sense let me know and I will attach a screenshot.

Debbie


#3

"Debbie Peabody wrote:
You can build a case statement in the calculated fields editor. There is a tool bar button to open the calculated fields editor. In the field definition there is a drop down that opens into an editor where you can put your case statement.

Or if you want, you can send to the SQL editor and build your SQL with the case statement in the SQL Editor and use the reverse engineering button to send back to the Query Builder and it will put into the calc field.

If this doesn’t make sense let me know and I will attach a screenshot.

Debbie"

Actually, I figured out the part using the reverse-engineering part from SQL-Editor to Query Builder, and saw that it stuck the CASE into the Calculated Fields. However, it showed some odd ASCII characters as part of the statement.

Do you have a screenshot of building the CASE statement directly into the Calculated Field? That would be helpful when getting my other users comfortable with doing this.

(and as a side note - is there a trick to quoting posts so that my comments don’t appear as part of the quote, like they do here?)


#4

Here is a screenshot with the steps.

Regarding the post. Are you posting from the community site or responding to it by email? You might try a private post or emailing me directly.

Debbie
CalcPing.png


#5

Thank you! This is exactly what I needed.


#6

Debbie Peabody wrote:

Regarding the post. Are you posting from the community site or responding to it by email? You might try a private post or emailing me directly.

If you are on the community site, just leave a couple lines at the top, enter your text, go back to the top and quote the desired text… works for me, anyway!